From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Berlin To: Andrew Cagney Cc: Subject: Re: Integrating DWARF2 CFA info Date: Thu, 10 May 2001 11:19:00 -0000 Message-id: References: <3AFAC8BB.7040306@cygnus.com> X-SW-Source: 2001-05/msg00233.html On Thu, 10 May 2001, Andrew Cagney wrote: > > Well, actually, IMHO, it is. > > The CFA info gives us the location of all saved registers for the entire > > procedure. > > It's always correct, even in the presence of optimization. > > Given the pc for the frame, it can tell you exactly where all the saved > > registers are, at that particular point in time. > > Therefore, it is strictly better to use the CFA info, than scan the > > instructions. > > > > So I see a strict hiearchy of what to use: > > Dwarf2 CFA Info > > > > This assumes that dwarf2 info is more correct than some other sort of info. Also, not only is it always correct, even in the presence of optimization (unless the compiler is broken), but accessing it and using it is architecture independent. All the arch dependent stuff is on the gcc side. In other words, it removes the need for making a new gdb port have to have functions to scan prologue and epilogue code to find register saves and whatnot. Also, unlike the scanning, DWARF2 CFA gives you a virtual frame for inline functions (if you want it), so you can treat them like normal functions calls, and the user doesn't have to care that the function was inlined. While some other debug format may come along that can provide this kind of info, there is absolutely no indication people are even developing new debug formats. Most compiler vendors seem perfectly content with DWARF2, because you can always extend it to handle some weird new language semantics by adding new tags and attributes. Past that, it can already (in 2.0) handle almost all optimized code situations, and 2.1 can handle *all* of them. What else do you need from a debug format? And if this debug format *did* come along, that gave somehow even better info to us (which isn't really possible, but that's besides the point), it would still maintain a strict ordering of prefernece. DWARF2 CFA info So I don't quite see what your objection to a stack is. There certainly is a strict ordering, and dwarf2 info is certainly more correct than what we do now, in all cases. It's always better, never worse. --Dan