This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
dwarf2-frame vs set_loc
- From: Daniel Jacobowitz <drow at false dot org>
- To: gdb at sourceware dot org, Mark Kettenis <kettenis at gnu dot org>
- Date: Thu, 28 Sep 2006 18:42:45 -0400
- Subject: dwarf2-frame vs set_loc
Hi Mark,
I can't work out a way to fix this in the time I've got this evening,
so I just wanted to record it, and send a copy your way in case you're
interested in fixing it; you're more familiar with dwarf2-frame.c and
the formats it handles than I am.
GCC was temporarily changed to use DW_CFA_set_loc at the start of FDEs.
I believe that change has now been backed out again; it was wrong (and
partly my fault). But Debian happened to pick up a snapshot containing
that patch and it caused a couple of GDB test failures. At least one,
anyway, I'm not sure if the other two had the same cause. This is on
x86_64.
I tracked the problem down to use of dwarf2_read_address. As far as I
can tell, what we really need is to use read_encoded_value for this.
But, that wants a "struct comp_unit" (misleading name? It's really not
DW_TAG_compile_unit related at all, it's the whole object). And we
don't have one any more by the time we're in execute_cfa_program, so
that's where I gave up.
Anyway, there's an 'R' augmentation specifying the encoding, which
happens to use only four bytes for pointers and not the eight that
dwarf2_read_address is expecting, and so we decide the first
instruction of the FDE is way out in the middle of nowhere. Backtraces
break.
--
Daniel Jacobowitz
CodeSourcery