From: Mark Kettenis <mark.kettenis@xs4all.nl>
To: roland.schwingel@onevision.de
Cc: gdb@sourceware.org
Subject: Re: gdb stack trace problems (Addendum)
Date: Fri, 22 Apr 2005 17:51:00 -0000 [thread overview]
Message-ID: <200504221751.j3MHpEB0002453@elgar.sibelius.xs4all.nl> (raw)
In-Reply-To: <4268B942.5080300@onevision.de> (message from Roland Schwingel on Fri, 22 Apr 2005 10:43:46 +0200)
Date: Fri, 22 Apr 2005 10:43:46 +0200
From: Roland Schwingel <roland.schwingel@onevision.de>
Hi Mark...
Have you already had some time to look into it?
I did, but I didn't have find the time to reply yet ;-).
Anyway, there is a serious problem here. The code you show is
basically undebuggable. SleepEx is basically what we call a frameless
function; it doesn't set up its own stack frame. This means the
debugger has to track all changes of the stack frame in this function
in order to be able to unwind the stack and provide a useful
backtrace. However, since this Windows uses the convention that the
caller pushes function arguments on the stack, and the callee is
repsonsible for restoring the stack. this gets basically impossible.
I'm wondering whether Microsoft provides debug versions of its DLLs
that don't have this problem.
The only thing we can do here is trust the frame pointer, like we used
to do in the old days. The problem with that is that it's very likely
to (silently) skip some function calls. In your particular example it
probably would appear as if your code called SleepEx directly and
there would be no trace of Sleep at all. That can be quite puzzling.
I'm thinking about adding an option to instruct gdb to "trust" the
frame pointer. I'm not going to make it the default though. I really
prefer seeing an abviously wrong backtrace over gdb silently skipping
function calls in its backtraces.
Mark
next prev parent reply other threads:[~2005-04-22 17:51 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-19 8:01 Roland Schwingel
[not found] ` <4268B942.5080300@onevision.de>
2005-04-22 17:51 ` Mark Kettenis [this message]
-- strict thread matches above, loose matches on Subject: below --
2005-05-10 8:39 Roland Schwingel
2005-05-10 8:38 Roland Schwingel
2005-05-02 7:04 Roland Schwingel
2005-05-08 13:31 ` Mark Kettenis
2005-05-08 23:20 ` Christopher Faylor
2005-05-09 4:48 ` Eli Zaretskii
2005-05-09 5:26 ` Christopher Faylor
2005-05-09 5:30 ` Stan Shebs
2005-04-26 11:53 Roland Schwingel
2005-04-26 9:11 Roland Schwingel
2005-04-25 12:35 Roland Schwingel
2005-04-25 8:00 ` Roland Schwingel
2005-04-25 19:35 ` Mark Kettenis
2005-04-25 19:45 ` Daniel Jacobowitz
2005-04-25 20:37 ` Mark Kettenis
2005-04-19 7:34 Roland Schwingel
2005-04-19 7:45 ` Mark Kettenis
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=200504221751.j3MHpEB0002453@elgar.sibelius.xs4all.nl \
--to=mark.kettenis@xs4all.nl \
--cc=gdb@sourceware.org \
--cc=roland.schwingel@onevision.de \
/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