This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] Move the frame zero PC check earlier


Daniel Jacobowitz <drow@false.org> writes:
> On Thu, May 11, 2006 at 03:24:31PM -0700, Jim Blandy wrote:
>> 
>> It looks good to me.  I'm just curious why we even bother looking up
>> the frame type for the older frame whose PC is zero.  (I understand
>> this test is inherited from the existing code.)
>
> You've gotta.  It looks like this:
>
> #0 somefunc ()
> #1 <signal handler called>
> #2 0x00000000 in Nothing At All
> #3 function_which_calls_its_arg (arg = (void (*)()) 0x00000000)
> #4 main ()
>
> There was a check for this at some point in the distant past - I
> believe it was committed, not just proposed - which didn't do this.
> Ergo signull.exp.
>
> Er... wait a second!  You're talking about a different frame than I am,
> aren't you?  Do you mean this?
>
> +  if (prev_frame->level > 0
> +      && get_frame_type (this_frame) == NORMAL_FRAME
> +      && get_frame_pc (prev_frame) == 0)

I think so.  Using the backtrace above as an example, I understood why
we need to know frame #1's type, but I didn't see the point in
checking frame #2's type.

But I think I do now.  If CALL_DUMMY_LOCATION is AT_ENTRY_POINT, and
the entry point is at address zero, then the test as written above
would truncate backtraces at dummy frames.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]