https://bugzilla.novell.com/show_bug.cgi?id=390722 User mmeeks@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=390722#c24 --- Comment #24 from Michael Meeks <mmeeks@novell.com> 2008-05-22 10:34:57 MST --- I managed to find some a friendly gdb hacker (or two) - who gave some helpful advice: <mjw> -fomit-frame-pointer might be standard these days <daney> Put a breakpoint on all 'call' and 'ret' instructions and record $sp each time you encounter one... <mjw> Ah, it was the section above that: http://sourceware.org/gdb/current/onlinedocs/gdbint_3.html#SEC8 <mjw> " 3.1 Prologue Analysis " Clever stuff :) <mjw> Anyway, I think fedora got this right. Just compile everything with -fasynchronous-unwind-tables then you don't need any heuristics. <mjw> Although I think daney's solution is also pretty slick :) Now, of course I'm clueless: do we compile currently with -fasynchronous-unwind-tables ? <aph_> mjw: ah, but we don't emit unwinder data for the prologue, that's the reason gdb can't just use the unwinder data, now I remember <mjw> Don't settle for -fexceptions! Go for the full monty! -fasynchronous-unwind-tables backtrace from any place! <aph_> mjw: even with -fasynchronous-unwind-tables we still aren't accurate in the prologue <mjw> aph_, I thought that was fixed? <aph_> I thought it was deliberate to save a lot of space <daney> Many distributions don't have any unwinding data for libraries written in C. This is the 21st. century. We have memory to burn now... <aph_> I can't imagine why anyone would want to fix it <mjw> because otherwise unwinding doesn't work reliably <mjw> I did work on this for frysk. I thought we got it all right. <aph_> it does, because you never uinwind in a prologue <mjw> I have to get my testcases, but I am pretty sure we have tests for stepping into and out a whole function. <aph_> but you use the debuginfo, don't you? * mjw was actually pretty proud that worked <daney> Really if you are using gdb, you should have accurate .debug_frame data for everything. leave .eh_frame for the runtime unwinder. <aph_> daney: yeah, exactly <mjw> aph_, in order eh_frame, debug_frame or heuristics based on peeking at the last few words on the stack and see if that was an address that contained a call instruction. <daney> Really everyone should be using a processor with fixed size instructions (like mips) where it is possible to do accurate unwinding with almost no meta data. <mjw> yeah, instruction decoding on x86 is so not fun! etc. etc. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.