[Bug debug/55586] New: Incorrect .debug_line section for function with variable number of arguments in PowerPC
pam at oktetlabs dot ru
gcc-bugzilla@gcc.gnu.org
Tue Dec 4 08:28:00 GMT 2012
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55586
Bug #: 55586
Summary: Incorrect .debug_line section for function with
variable number of arguments in PowerPC
Classification: Unclassified
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: debug
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: pam@oktetlabs.ru
This is PowerPC problem.
Example:
Code:
int
my_function(int x, ...)
{
return x+1;
}
dwarfdump for this code shows the following .debug_line section:
...
0x01800490 [ 3, 0] NS uri: "1.c"
0x018004bc [ 3, 0] NS
0x018004e0 [ 4, 0] NS
...
Disassembler in GDB shows:
(gdb) disass my_function
Dump of assembler code for function my_function:
0x01800490 <+0>: stwu r1,-120(r1)
0x01800494 <+4>: stw r31,116(r1)
0x01800498 <+8>: mr r31,r1
0x0180049c <+12>: stw r4,12(r31)
0x018004a0 <+16>: stw r5,16(r31)
0x018004a4 <+20>: stw r6,20(r31)
0x018004a8 <+24>: stw r7,24(r31)
0x018004ac <+28>: stw r8,28(r31)
0x018004b0 <+32>: stw r9,32(r31)
0x018004b4 <+36>: stw r10,36(r31)
0x018004b8 <+40>: bne cr1,0x18004dc <my_function+76>
0x018004bc <+44>: stfd f1,40(r31)
0x018004c0 <+48>: stfd f2,48(r31)
0x018004c4 <+52>: stfd f3,56(r31)
0x018004c8 <+56>: stfd f4,64(r31)
0x018004cc <+60>: stfd f5,72(r31)
0x018004d0 <+64>: stfd f6,80(r31)
0x018004d4 <+68>: stfd f7,88(r31)
0x018004d8 <+72>: stfd f8,96(r31)
0x018004dc <+76>: stw r3,104(r31)
....
So at try to set breakpoint at my_function() function, GDB sets breakpoint at
address 0x018004bc, which is not correct because this address is unreachable if
we do not pass floating point arguments to my_function().
More information about the Gcc-bugs
mailing list