From: Pedro Alves <pedro@codesourcery.com>
To: gdb-patches@sourceware.org, danny.backx@scarlet.be
Subject: Re: Post mortem debugging for Windows CE
Date: Tue, 28 Apr 2009 16:02:00 -0000 [thread overview]
Message-ID: <200904281702.30473.pedro@codesourcery.com> (raw)
In-Reply-To: <1240929901.29047.110.camel@dannypc>
On Tuesday 28 April 2009 15:45:01, Danny Backx wrote:
> Hi,
>
> I wrote a program, see below, that can be used either on a development
> host, or on a Windows CE target, to decode stuff from a dump file as
> generated by CE.
>
> I don't think gdb currently has this capability (to inspect postmortem
> dump files) for debugging CE applications.
These are minidump files, right? The same infrastructure could
be used for minidumps for desktop Windows apps? I've never used
a minidump, but, IIRC, these are a form of bare-essential core
dumps, without much of memory contents? I'm not exactly sure what
kinds of info a minidump contains -- I'd expect at least the register
contexts of all threads in the process, and the list of loaded
dlls, along with their load addresses. Is it possible to recontruct
a call stack from these? Do they include stack memory?
> Is this something I should port into the gdb source tree and submit, or
> is it not worth it ? If yes, please advise where this belongs.
Can you clarify what you mean exactly by porting to the gdb source
tree? If you mean integrating it as a standalone app as is currently,
then, this would better go into binutils, as a minidump
dumper. You'd want to make it build independantly if any CE headers.
If you mean adding gdb support to load minidump files, I can think
of several ways to skin that cat:
1) write a minidump -> elf core dump translator. Base the core file
notes on the cygwin elf core format, for e.g.. See e.g,
src/bfd/elf.c:elfcore_grok_win32pstatus, and cygwin's dumper utility
sources for inspiration. Probably no bfd changes are required
this way. Teach src/gdb/arm-wince-tdep.c how to extract loaded
dll list from the core's .module sections. See
src/gdb/i386-cygwin-tdep.c:windows_core_xfer_shared_libraries. We could
probably reuse most of this.
2) teach bfd proper about minidumps, and export the register
set info with fake .reg sections, similarly to how we do for elf
core dumps. If you export the same set of sections GDB expects from
elf cores (e.g., .reg/XXX sections for thread register sets, .module sections
for loaded dlls.), then the GDB tweaks are the same as
for #1 above. E.g, teach src/gdb/arm-wince-tdep.c how to extract the loaded
dll list from the core's .module sections.
3) Teach GDB about minidumps, by adding a new minidump target_ops,
similar in vein to src/gdb/corelow.c. GDB doesn't currenly like
having more than on core file target_ops, though.
4) forget about adding support for minidumps, or post-processing them
to elf; and instead port cygwin's dumper.exe utility to CE, making
it spit real elf full-contents core dumps. This assumes you have
memory space on the device for this, of course.
--
Pedro Alves
next prev parent reply other threads:[~2009-04-28 16:02 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-28 14:45 Danny Backx
2009-04-28 16:02 ` Pedro Alves [this message]
2009-04-28 17:48 ` Danny Backx
2009-04-28 19:18 ` Danny Backx
2009-04-29 7:10 ` Eli Zaretskii
2009-04-29 7:19 ` Danny Backx
2009-04-29 7:44 ` Eli Zaretskii
2009-04-30 7:25 ` Danny Backx
2009-04-30 9:58 ` Pedro Alves
2009-05-01 14:35 ` Danny Backx
2009-05-01 15:37 ` Pedro Alves
2009-05-05 13:31 ` Danny Backx
2009-05-05 16:53 ` Pedro Alves
2009-05-06 14:13 ` Danny Backx
2009-05-06 14:34 ` Pedro Alves
2009-05-06 20:05 ` Danny Backx
2009-05-06 20:47 ` Pedro Alves
2009-05-07 1:21 ` Danny Backx
2009-05-10 19:21 ` Pedro Alves
2009-05-11 14:03 ` Danny Backx
2009-05-11 15:00 ` Danny Backx
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200904281702.30473.pedro@codesourcery.com \
--to=pedro@codesourcery.com \
--cc=danny.backx@scarlet.be \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox