[RFC] Infinite backtraces...
Andrew Cagney
cagney@gnu.org
Fri Dec 3 19:26:00 GMT 2004
>>The other thing that would help here is for glibc's CFI to identify the
>>return-address (and CFA) column as unknown (assuming I've got my CFI
>>term correct) on the outer most frame. It would then be easy for
>>dwarf2-unwind to identify this. It's been discussed, agreed, but not
>>implemented.
>
>
> This is of course a good solution, provided that you can use dwarf2.
> On 32bit HP/UX, we're stuck.
Doh!
>>Right, but it shouldn't need an additional method. The per-architecture
>>unwinder, when it detects a frame that the ABI specifies as final,
>>should return a null frame ID. For instance, the PPC ABI explicitly
>>specifies that it's stack be terminated with a zero SP.
>
>
> I am not sure this is doable. Is it? Let me check that again. Perhaps
> it's ok to create the frame object, but then later compute a null frame
> ID for it? As far as I remember, the sequence of events is like this
> when trying to build the frame chain:
>
> . get_prev_frame (this_frame):
> . get_frame_id (this_frame)
> . frame_id (next_frame, this_cache)
> . check this frame ID
> . build previous frame
> (frame ID unset)
Yes, gdb already creates the frame object and then later constructs the
frame ID. The build has been reduced to:
prev_frame = malloc ();
prev_frame->next = this_frame;
return prev_frame;
Also note that, unlike the past, the frame ID is separate to the ``frame
base'' the former can be NULL while the later is still valid.
> And then, after building each new frame, we display the information
> for that new frame.
It is what lets us "up" on to an apparently corrupt frame.
>>Finally, a more long term suggestion is that we add a mechanism for
>>creating or adding attributes to symbols (for instance for signal
>>trampolines). An atribute of such a symbol could be that it is
>>outermost.
>
>
> But could we determine that a symbol is outermost. And couldn't the
> same symbol be used in both contexts?
Determining that a symbol is outer-most is somewhat osabi dependant -
the arch dependant code would need to register or mark it up as such.
Yes, the symbol can be used in both contexts vis:
main (argc) { if (argc > 0) main (argc - 1); }
but I suspect it is illegal.
Andrew
More information about the Gdb-patches
mailing list