This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
gcc HEAD, bad DW_CFA_offset register
- From: mec dot gnu at mindspring dot com (Michael Elizabeth Chastain)
- To: gdb at sources dot redhat dot com
- Date: Fri, 2 Jul 2004 04:51:59 -0400 (EDT)
- Subject: gcc HEAD, bad DW_CFA_offset register
I'm getting a lot of gdb test suite regressions with gcc HEAD 2004-07-01
compared to gcc HEAD 2004-06-17. stabs+ is okay but dwarf-2 has about
1000 differences, almost all bad.
I think there's a bug in gcc's dwarf-2 emitter. Can Daniel J, or
somebody else who knows dwarf-2, check me on this?
Here is a function from arch/i386-unwind.c:
void
trap (void)
{
asm ("int $0x03");
}
Here is the good-looking CFA information from gcc HEAD 2004-06-17:
00000028 00000014 00000014 FDE cie=00000014 pc=08048318..0804831e
DW_CFA_advance_loc: 1 to 08048319
DW_CFA_def_cfa_offset: 8
DW_CFA_offset: r5 at cfa-8
DW_CFA_advance_loc: 2 to 0804831b
DW_CFA_def_cfa_reg: r5
Looks okay to me. This is native i686-pc-linux-gnu so r5 is $ebp.
Here is the strange CFA information from gcc HEAD 2004-07-01:
00000028 00000014 00000014 FDE cie=00000014 pc=08048318..0804831e
DW_CFA_advance_loc: 1 to 08048319
DW_CFA_def_cfa_offset: 8
DW_CFA_offset: r6 at cfa-8
DW_CFA_advance_loc: 2 to 0804831b
DW_CFA_def_cfa_reg: r5
This is strange: the r5 changed to an r6! (r5=$ebp, r6=$esi)
This confuses gdb when it's locating frames; I get a bad backtrace
and a FAIL.
This is r5->r6 change is the *only* difference (besides version strings)
from 20040617.s to 20040701.s.
I just want to check that I am reading the CFA's correctly and
that the second version of the FDE is messed up. Is that right?
If so, I'll narrow it down to a particular gcc patch and file
a PR against gcc HEAD.
Michael C