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


Andrew Cagney wrote:
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?

Yes.

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).

I think cfi_frame_chain() does what you expect from cfi-frame unwinding function. However it is useless if you have no CFI info ;-) And that's the goal of my patch - provide a CFI when there are none and continue as if it was there for ages.
cfi_frame_chain() is currently being replaced by frame->id_unwind().

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

There is a lot of different cases (functions with and without prologue, functions allocating some space on the stack, signal trampolines, etc.), and each one of would need to have a special handler. My approach seems to be more general to me (only one more function per architecture and several sets of data). And no, it wouldn't be better to do it a different way, because this way it's already written and verified that it works ;-)
Andrew



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