This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] Artifical dwarf2 debug info


Hi all,
this long patch provides a fix for a very annoying fact, that GDB on x86-64 can't do backtraces from hand-optimized assembler functions (that applies for example to glibc's memset, str*, etc as well as to syscall wrappers).
This is caused by the lack of a valid debug_frame/eh_frame FDE entry for such a function (noone really writes .debug_frame section in his assembler code :-)

My approach to fix this behaviour is based on the fortunate fact, that most of those affected glibc's functions don't touch the stack at all, so creating an artifical FDE for them is easy.
If I understand this correctly, you've created create dwarf2cfi info for a function that has no such info. That way the dwarf2cfi code can unwind a function that doesn't actually have CFI?

If that is the case then I don't think this is either necessary or correct. A `struct frame_info' allows frame specific unwind functions - at present only dummy-frame and saved-regs-frame versions are implemented, however the next ones to implement are cfi-frame (unwind using CFI info) and regs-frame (unwind using the register cache).

For your problem, wouldn't it be better to, instead of creating fake CFI info, implement custom frame unwind functions that handle your case?

Andrew



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]