Re: [RFC] breakpoints and function prologues...

Andrew Cagney
2002-08-15T05:57:25Z

> I agree with Jim here. I think most folks are actually surprised to find that if they break on the "{" beginning a function (or indeed anywhere before the first executable line of code) then their backtrace will not be correct. Understanding why this is so requires you to "pay attention to the man behind the curtain", and that we breaks the illusion that source code maps straight-forwardly onto the running program. Where this extra knowledge is helpful (like when debugging optimized code) it is fine to require folks to have it. But here, where it really doesn't do any good, I think it is just confusing. And, of course, it causes big heartburn for GUIs the varobj code, as I said earlier.
>
> I doubt that "{" breaks on the prologue is a crucial feature of gdb, and given that there are other ways to do this, I don't think it is really worth supporting...

Michael is right here. If a CLI user sets a breakpoint on a line (with
code) then that user clearly wants the breakpoint set on that line.

If an architecture can't unwind the frame for that breakpoint address
then that is a bug in the architecture and/or GDB. The main reason the
average prologue analyzer doesn't handle breakpoints in the prologue is,
I think, more a factor of not being tested then of being ``hard''.

Andrew

> On Saturday, August 3, 2002, at 10:32 PM, gdb-patches-digest-help@sources.redhat.com wrote:
>
> From: Jim Blandy <jimb@redhat.com>
> Date: Fri Aug 2, 2002 11:48:26 PM US/Pacific
> To: Michael Snyder <msnyder@redhat.com>
> Cc: Joel Brobecker <brobecker@gnat.com>, gdb-patches@sources.redhat.com
> Subject: Re: [RFC] breakpoints and function prologues...
>
>
>
> Michael Snyder <msnyder@redhat.com> writes:
> So I'd support changing `break LINENO' to always skip the prologue.
>
> I would not. It's changing a behavior that people have
> become accustomed to.
>
> Well, that alone isn't a good reason to keep a behavior, is it? I
> mean, it's pretty confusing. And there's a good alternative.
>
>
>
> --
> Jim Ingham jingham@apple.com
> Developer Tools - gdb
> Apple Computer
>
>