Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jim Blandy <jimb@codesourcery.com>
To: pgilliam@us.ibm.com
Cc: Andrew STUBBS <andrew.stubbs@st.com>,
		  Joel Brobecker <brobecker@adacore.com>,
		  Daniel Jacobowitz <drow@false.org>,
		  Mark Kettenis <mark.kettenis@xs4all.nl>,
	 gdb-patches@sourceware.org
Subject: Re: [RFC] Move the frame zero PC check earlier
Date: Thu, 18 May 2006 20:04:00 -0000	[thread overview]
Message-ID: <vt2wtcjjjc2.fsf@theseus.home.> (raw)
In-Reply-To: <1147969938.3672.168.camel@dufur.beaverton.ibm.com> (PAUL GILLIAM's message of "Thu, 18 May 2006 09:32:18 -0700")


PAUL GILLIAM <pgilliam@us.ibm.com> writes:
> On Thu, 2006-05-18 at 09:53 -0700, Jim Blandy wrote:
>> Andrew STUBBS <andrew.stubbs@st.com> writes:
>> > Jim Blandy wrote:
>> >> For the record, at the top of this thread I said I thought it was
>> >> fine, too.  I've run into these often enough due to deliberate
>> >> attempts by runtimes to terminate the stack that I think it outweighs
>> >> the (minor, to my mind) value of seeing a 0x00000000 frame that
>> >> indicates an actual error.
>> >> GDB should be honest with the user about what it finds, but I don't
>> >> think we can be a multi-platform debugger and be that picky about
>> >> confining each bit of logic to exactly the platforms that promise to
>> >> uphold it.
>> >
>> > How about adding a command:
>> >
>> > set backtrace terminate-on-zero-pc on|off
>> >
>> > and let the user decide. Set it to 'on' by default on the principle
>> > that, if they aren't aware of the possibility, users don't want to see
>> > zero frames they don't understand.
>> >
>> > Just a thought.
>> 
>> Well, that would lift the burden of the decision from our shoulders
>> (that is, GDB developers', not restricted to the folks here) to the
>> users'.  I think we're probably in a better position to make it.
>
> No, that lifts the burden of deciding for *all* users from our
> shoulders, allowing those users who understand the issues to override
> our decision.
>
> On the other hand, it would add one more user tweek that most users
> would not understand or care about.
>
> It's a hard call.
>
> I'd vote for the new command and classify it as obscure.

Okay --- I should be less equivocal.  It is a bad idea to add this
command, obscure or otherwise.  Engineers do this all the time when
they're having difficulty settling on a solution: they figure, hey,
let's let the users decide!  It's presented as "giving the users more
control".  Nobody wants to argue with that: every day we run into
something we wish we could tweak.  Today I wished I could control the
'From' address vixie cron uses in its mail messages.  But it's a
mistake to treat this as an indication of the general desireability of
more switches and knobs.  And half the time the knobs are just
workarounds for some other problem --- for example, I think the real
problem with my cron is that outgoing mail on my machine is
misconfigured.

Nobody has written us saying they want to choose whether GDB treats a
zero return address as indicating the end of the stack.  Rather, many
users have written us complaining that GDB displays extra frames at
the end of well-formed, non-corrupt stacks.  And over the course of
the what seems like dozens of embedded GDB ports I've debugged since
1997, I've come across the same behavior many times myself.

The only reason presented in this thread for displaying those frames
at all is that it can be an indication of a bug in GDB.  This is based
on the (sound) general argument that GDB should be picky about the
state it examines, and report anomalies.  But that heuristic just
doesn't make sense when the particular "anomaly" at hand is, in fact,
a valid and deliberate end-of-stack indicator on many systems.


  reply	other threads:[~2006-05-18 18:09 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-10 18:03 Daniel Jacobowitz
2006-05-11 10:42 ` Andrew STUBBS
2006-05-11 22:24 ` Jim Blandy
2006-05-11 22:32   ` Daniel Jacobowitz
2006-05-12  6:21     ` Jim Blandy
2006-05-12 12:46       ` Daniel Jacobowitz
2006-05-13 10:14 ` Mark Kettenis
2006-05-13 15:17   ` Daniel Jacobowitz
2006-05-13 15:46     ` Daniel Jacobowitz
2006-05-13 17:08       ` Mark Kettenis
2006-05-13 16:49     ` Mark Kettenis
2006-05-13 18:53       ` Daniel Jacobowitz
2006-05-16 21:38       ` Daniel Jacobowitz
2006-05-16 22:19         ` Mark Kettenis
2006-05-16 22:46           ` Daniel Jacobowitz
2006-05-16 23:53             ` PAUL GILLIAM
2006-05-18  1:35               ` Joel Brobecker
2006-05-18  9:31                 ` Jim Blandy
2006-05-18 10:09                   ` Andrew STUBBS
2006-05-18 17:36                     ` Jim Blandy
2006-05-18 18:09                       ` PAUL GILLIAM
2006-05-18 20:04                         ` Jim Blandy [this message]
2006-05-18 20:43                           ` Mark Kettenis
2006-05-18 23:31                             ` Jim Blandy
2006-05-20 22:26                               ` Mark Kettenis
2006-05-21  2:12                                 ` Daniel Jacobowitz
2006-07-21 15:52                                   ` Andrew STUBBS
2006-07-22 11:23                                     ` Mark Kettenis
2006-07-24 19:32                                       ` Daniel Jacobowitz
2006-07-26 22:16                                         ` Mark Kettenis
2006-07-26 22:25                                           ` Daniel Jacobowitz
2006-05-19  3:32                             ` Daniel Jacobowitz
2006-05-20 21:30                               ` Mark Kettenis
2006-05-19 12:26                             ` Eli Zaretskii
2006-05-19 18:12                               ` Jim Blandy
2006-05-19 18:53                                 ` Eli Zaretskii
2006-05-22 23:15                                   ` Jim Blandy
2006-05-15 13:57   ` Andrew STUBBS

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=vt2wtcjjjc2.fsf@theseus.home. \
    --to=jimb@codesourcery.com \
    --cc=andrew.stubbs@st.com \
    --cc=brobecker@adacore.com \
    --cc=drow@false.org \
    --cc=gdb-patches@sourceware.org \
    --cc=mark.kettenis@xs4all.nl \
    --cc=pgilliam@us.ibm.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