3 ms·
I’m confused, why would the debugging information file be an executable? These are just debugging symbols, no?
by overbytecode 3y ago
I’m confused, why would the debugging information file be an executable? These are just debugging symbols, no?
- matthews2 3y agoThe debug info is stored in an elf file, just like an executable. You can have them together in the same file, or you can use a tool like objcopy to make them separate.
- mschuster91 3y ago> or you can use a tool like objcopy to make them separate which is how Debian generates the -debug packages [1]. [1] https://github.com/Debian/debhelper/blob/master/dh_strip https://github.com/Debian/debhelper/blob/master/dh_strip
- brancz 3y agoDWARF is touring complete and not the accidental kind, it has instructions and all. GDB implements the whole set so you can basically make GDB do arbitrary code execution if you control the DWARF data.
- jcranmer 3y agoAs far why it's not accidental, one of the primary purposes of DWARF is to be able to essentially describe "this source-level value is described by f(memory, registers)". Even if you wanted to restrict it to just the simple conditions like "this is described at stack offset N", there are cases where there might be variably-sized objects on the stack, and so you'd need to run a small function just to compute "N".