Re: How does GDB get the function call stack
Andrew Burgess via Gdb <[email protected]>
| Newsgroups | gmane.comp.gdb.devel |
|---|---|
| Message-ID | <[email protected]> |
Luis Machado via Gdb <[email protected]> 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