How does GDB get the function call stack

hilbert swdtian@163.com
Fri Aug 19 01:57:38 GMT 2022


For me, totally understand this.

It's unbelievable how knowledgeable you specialists are.

Thank you very much.








At 2022-08-18 22:05:16, "Andrew Burgess" <aburgess@redhat.com> wrote:
>Luis Machado via Gdb <gdb@sourceware.org> writes:
>
>> On 8/16/22 08:43, hilbert via Gdb wrote:
>>> Hi ,
>>> There are 4 ways to get the function call stack in the GDB Internals Manual.   https://sourceware.org/gdb/papers/unwind.html
>>> For x86_64, does GDB get information by parsing the .eh_frame section? Or just get the call stack by Parse the function prologues.
>>> 
>>> 
>>> 
>>
>> I'd say mostly 1 and 2. 1 is usually used with functions without debug
>> information. 2 is used when there is debug information.
>
>To expand on this a little, at least for version of GCC I'm using on
>x86-64, the .eh_frame data replaces the .debug_frame data, so #2 and #3
>are effectively merged.
>
>The two "issues" raised against .eh_frame don't make sense to me.  As
>I understand it the .eh_frame encoding is roughly the same as the
>.debug_frame encoding, so I don't think there's much space saving, and
>GDB reads the .eh_frame information from the ELF, so the read-only
>concern seems like a non-issue.
>
>Thanks,
>Andrew


More information about the Gdb mailing list