From: Brian Dessent <brian@dessent.net>
To: Pedro Alves <pedro@codesourcery.com>
Cc: gdb@sourceware.org, Eli Zaretskii <eliz@gnu.org>,
Michael Snyder <msnyder@specifix.com>,
divis1969@mail.ru
Subject: Re: How to catch GDB crash
Date: Mon, 23 Jun 2008 19:37:00 -0000 [thread overview]
Message-ID: <485FFBD8.6E368E9C@dessent.net> (raw)
In-Reply-To: <200806231936.32289.pedro@codesourcery.com>
Pedro Alves wrote:
> for native Windows apps, there is some registry key (I don't
> remember which) you can set to point to a JIT debugger. Probably
For the sake of the archives it's HKLM\SOFTWARE\Microsoft\Windows
NT\CurrentVersion\AeDebug, see <http://support.microsoft.com/kb/103861>.
> a little exe wrapper is needed to translate the incoming args
> to GDB args, that's all.
The first %ld in the command expands to the faulting PID so
"path-to\gdb.exe -p %ld" ought to work without need for a wrapper.
> I can't see what changes in GDB
> would be required?
The main problem is that gdb thinks that it's attaching to a normal
running process, rather than a faulted app. Thus the current thread is
an artificial one with %eip in ntdll!DbgUiConnectToDbg which is just a
convenient 'int3' that lives in ntdll.dll as discussed. That's easily
fixed just by switching to the thread of interest, however the state of
that thread often looks something bogus like this:
(gdb) bt
#0 0x7c90eb94 in ntdll!LdrAccessResource ()
from C:\WINXP\system32\ntdll.dll
#1 0x7c90e9ab in ntdll!ZwWaitForMultipleObjects ()
from C:\WINXP\system32\ntdll.dll
#2 0x7c86372c in UnhandledExceptionFilter ()
from C:\WINXP\system32\kernel32.dll
#3 0x00000002 in ?? ()
#4 0x0022f560 in ?? ()
#5 0x00000001 in ?? ()
#6 0x00000001 in ?? ()
#7 0x00000000 in ?? ()
The actual location of the fault in the user code is nowhere evident (in
this testcase, it was at eip 00401304) because gdb doesn't know that it
has picked up in the middle of a fault. You can get things back on
track by re-triggering the same fault again by continuing, but this
really isn't pretty and doesn't always work. For this to work correctly
gdb would need some command line switch to tell it that it's taking over
a faulted process as the JIT, rather than breaking in on a normally
executing one.
Brian
next prev parent reply other threads:[~2008-06-23 19:37 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-23 16:32 Dmitry Smirnov
2008-06-23 16:57 ` Aleksandar Ristovski
2008-06-23 17:12 ` Michael Snyder
2008-06-23 18:23 ` Eli Zaretskii
2008-06-23 18:32 ` Michael Snyder
2008-06-23 18:36 ` Pedro Alves
2008-06-23 19:37 ` Brian Dessent [this message]
2008-06-23 20:50 ` Dr. Rolf Jansen
2008-06-23 20:59 ` Dr. Rolf Jansen
2008-06-24 8:52 Dmitry Smirnov
2008-06-24 12:39 Dmitry Smirnov
2008-06-24 12:58 ` Pedro Alves
2008-06-24 17:03 Dmitry Smirnov
2008-06-24 17:29 ` Pedro Alves
2008-06-25 8:03 ` Dmitry Smirnov
2008-06-25 23:28 ` Pedro Alves
2008-06-26 13:56 ` Dmitry Smirnov
2008-06-26 14:21 ` Pedro Alves
2008-06-26 14:33 ` Dmitry Smirnov
2008-06-30 15:58 ` Dmitry Smirnov
2008-07-02 11:05 ` Dmitry Smirnov
2008-07-02 11:52 ` Pedro Alves
2008-07-02 12:51 ` Re[2]: " Dmitry Smirnov
2008-07-05 3:15 ` Pedro Alves
2008-07-07 8:36 ` Dmitry Smirnov
2008-07-07 14:29 ` Pedro Alves
2008-07-07 15:47 ` Dmitry Smirnov
2008-07-07 16:01 ` Pedro Alves
2008-07-08 8:27 ` Dmitry Smirnov
2008-07-01 11:38 ` Vladimir Prus
2008-07-01 11:41 ` Pedro Alves
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=485FFBD8.6E368E9C@dessent.net \
--to=brian@dessent.net \
--cc=divis1969@mail.ru \
--cc=eliz@gnu.org \
--cc=gdb@sourceware.org \
--cc=msnyder@specifix.com \
--cc=pedro@codesourcery.com \
/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