From: Mark Kettenis <mark.kettenis@xs4all.nl>
To: drow@false.org
Cc: gdb-patches@sourceware.org
Subject: Re: [rfc, frame] Add backtrace stop reasons
Date: Sun, 20 Aug 2006 16:50:00 -0000 [thread overview]
Message-ID: <200608201438.k7KEcJho022644@elgar.sibelius.xs4all.nl> (raw)
In-Reply-To: <20060819154646.GA25238@nevyn.them.org> (message from Daniel Jacobowitz on Sat, 19 Aug 2006 11:46:46 -0400)
> Date: Sat, 19 Aug 2006 11:46:46 -0400
> From: Daniel Jacobowitz <drow@false.org>
>
> I've been thinking some more about the conversation we had, on treating
> PC==0 as a frame terminator. This patch and the next patch don't
> directly affect that, but they address the general issue Mark raised:
> letting the user know why a backtrace stopped.
>
> This patch adds a list of "enum unwind_stop_reason". When we try to
> unwind a frame and fail, we record the reason why we failed, rather
> than calling error. Backtrace can then choose to stop silently or
> display the reason. I preserved which reasons get displayed and which
> don't. The zero frame PC check doesn't happen here, so an independent
> patch would be to move it here so that a reason is included, and
> another independent patch would be whether to treat it as an error
> condition or not.
>
> A nice bonus, in my opinion: if the backtrace stops because unwinding
> detects an error or the end of the stack, "info frame" will explain
> why. For instance:
>
> Stops backtrace: previous frame inner to this frame (corrupt stack?)
Is this really useful? It adds an extra line to the "info frame"
output, which might mean that more useful information about the frame
scrolls of my screen :(.
> Any comments on this patch? It doesn't have any major change on GDB's
> visible behavior; it changes one error to a printf, but that error was
> always wrapped in a catch_exceptions anyway, so this is unimportant.
> The text of the message on a corrupt stack is changed mildly; it says
> "Backtrace stopped: previous..." rather than just "Previous...".
That's a useful clarification I think.
The implementation looks good to me, but I don't see why we need this
functionality yet. Can you hold on to this until we really need it?
> 2006-08-19 Daniel Jacobowitz <dan@codesourcery.com>
>
> * frame.c (struct frame_info): Add stop_reason.
> (get_prev_frame_1): Set stop_reason. Don't call error for
> stop reasons.
> (get_frame_unwind_stop_reason, frame_stop_reason_string): New.
> * frame.h (enum unwind_stop_reason): New.
> (get_frame_unwind_stop_reason, frame_stop_reason_string): New
> prototypes.
> * stack.c (frame_info): Print the stop reason.
> (backtrace_command_1): Print the stop reason for errors.
next prev parent reply other threads:[~2006-08-20 14:38 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-20 13:02 Daniel Jacobowitz
2006-08-20 16:50 ` Mark Kettenis [this message]
2006-08-20 17:05 ` Daniel Jacobowitz
2006-08-22 20:24 ` Mark Kettenis
2006-08-22 20:38 ` Daniel Jacobowitz
2006-08-22 20:49 ` Mark Kettenis
2006-08-22 20:58 ` Daniel Jacobowitz
2006-10-05 22:33 ` Daniel Jacobowitz
2006-10-18 19:52 ` Daniel Jacobowitz
2006-08-21 12:50 ` Daniel Jacobowitz
2006-08-22 20:41 ` 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=200608201438.k7KEcJho022644@elgar.sibelius.xs4all.nl \
--to=mark.kettenis@xs4all.nl \
--cc=drow@false.org \
--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