public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* problems parsing dwarf frame info on amd64 optimized code
@ 2004-03-08 19:18 Max Asbock
  2004-03-10  2:18 ` Jim Wilson
  2004-03-10 19:41 ` Richard Henderson
  0 siblings, 2 replies; 5+ messages in thread
From: Max Asbock @ 2004-03-08 19:18 UTC (permalink / raw)
  To: gcc

Hi all,

I am trying to parse the dwarf frame info on amd64 using the dwarf parser
from libunwind which I had to slightly modify to run on amd64.
The parser works correctly in unoptimized code that uses frame pointers.
When I turn on the -O flag things fall apart. This is with gcc 3.2.2.
The parser finds two rules in the CIE:
CFA_def_cfa r7+0x8           (rsp)
CFA_offset r16 at cfa-0x8  (return address)
and then in the FDE it finds:
...
CFA_def_cfa_offset <offset>
...

This works for stepping from the first frame to the second, but
on the next step it fails, since the CFA is read again from r7 (rsp)
which hasn't changed. And it seems that the CFA <offset> is the
offset relative to the current CFA, not relative to the value in rsp.
I hope I am making sense. I am not a gcc nor a dwarf expert, so 
I don't really know if the compiler is generating the correct dwarf info
and the parser needs to do something different or the other way
around.

Any help or hints would be greatly appreciated.

regards,
max 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-03-11 21:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-08 19:18 problems parsing dwarf frame info on amd64 optimized code Max Asbock
2004-03-10  2:18 ` Jim Wilson
2004-03-10 19:41 ` Richard Henderson
2004-03-11 18:45   ` Max Asbock
2004-03-11 21:00     ` Richard Henderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).