Reputation: 191
We can set breakpoint at a func, hence gdb knows the entrance and exit address of a certain function. But how does it get this information? Does it uses DWARF or readelf for the executable, if yes, how? Thanks
Upvotes: 1
Views: 227
Reputation: 16888
A function is described in DWARF with a DIE (debugging information entry) with tag DW_TAG_subroutine
. The DIE has attributes DW_AT_low_pc
and DW_AT_high_pc
, which give the bounds of the function.
Upvotes: 0
Reputation: 213596
GDB uses multiple "signals":
DWARF
, STABS
, or
something else depending on the
platform and the compiler).Generally GDB will not call into "external" readelf
executable -- it contains all the smarts to read the info directly.
If you want to know exactly how this is done, read the source.
Upvotes: 1