jan.kratochvil at redhat dot com
2013-03-04 14:13:55 UTC
http://sourceware.org/bugzilla/show_bug.cgi?id=15223
Bug #: 15223
Summary: reversed order of inlined function parameters
Product: gdb
Version: HEAD
Status: NEW
Severity: normal
Priority: P2
Component: symtab
AssignedTo: ***@sourceware.org
ReportedBy: ***@redhat.com
Classification: Unclassified
Target: x86_64-unknown-linux-gnu
--------------------------------------------------------------------------------
int v;
__attribute__((always_inline)) static void
f (int a, int b, int c)
{
v = a + b + c;
}
int
main (void)
{
f (1, 2, 3);
return 0;
}
--------------------------------------------------------------------------------
gcc -Wall -g
(it occurs also with -O2 and without explicit always_inline)
--------------------------------------------------------------------------------
OK:
<1><2d>: Abbrev Number: 2 (DW_TAG_subprogram)7
<2e> DW_AT_name : f
<2><38>: Abbrev Number: 3 (DW_TAG_formal_parameter)
<39> DW_AT_name : a
<2><41>: Abbrev Number: 3 (DW_TAG_formal_parameter)
<42> DW_AT_name : b
but the instance has them in reversed order:
<2><81>: Abbrev Number: 6 (DW_TAG_inlined_subroutine)
<82> DW_AT_abstract_origin: <0x2d>
<86> DW_AT_low_pc : 0x40046d
<8e> DW_AT_high_pc : 0x40047e
<3><a0>: Abbrev Number: 7 (DW_TAG_formal_parameter)
<a1> DW_AT_abstract_origin: <0x41>
<a5> DW_AT_location : 2 byte block: 91 68 (DW_OP_fbreg: -24)
<3><a8>: Abbrev Number: 7 (DW_TAG_formal_parameter)
<a9> DW_AT_abstract_origin: <0x38>
<ad> DW_AT_location : 2 byte block: 91 6c (DW_OP_fbreg: -20)
--------------------------------------------------------------------------------
GDB output is reversed then:
f (c=3, b=2, a=1) at 16.c:5
It was rejected as a GCC PR:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49828
Bug #: 15223
Summary: reversed order of inlined function parameters
Product: gdb
Version: HEAD
Status: NEW
Severity: normal
Priority: P2
Component: symtab
AssignedTo: ***@sourceware.org
ReportedBy: ***@redhat.com
Classification: Unclassified
Target: x86_64-unknown-linux-gnu
--------------------------------------------------------------------------------
int v;
__attribute__((always_inline)) static void
f (int a, int b, int c)
{
v = a + b + c;
}
int
main (void)
{
f (1, 2, 3);
return 0;
}
--------------------------------------------------------------------------------
gcc -Wall -g
(it occurs also with -O2 and without explicit always_inline)
--------------------------------------------------------------------------------
OK:
<1><2d>: Abbrev Number: 2 (DW_TAG_subprogram)7
<2e> DW_AT_name : f
<2><38>: Abbrev Number: 3 (DW_TAG_formal_parameter)
<39> DW_AT_name : a
<2><41>: Abbrev Number: 3 (DW_TAG_formal_parameter)
<42> DW_AT_name : b
but the instance has them in reversed order:
<2><81>: Abbrev Number: 6 (DW_TAG_inlined_subroutine)
<82> DW_AT_abstract_origin: <0x2d>
<86> DW_AT_low_pc : 0x40046d
<8e> DW_AT_high_pc : 0x40047e
<3><a0>: Abbrev Number: 7 (DW_TAG_formal_parameter)
<a1> DW_AT_abstract_origin: <0x41>
<a5> DW_AT_location : 2 byte block: 91 68 (DW_OP_fbreg: -24)
<3><a8>: Abbrev Number: 7 (DW_TAG_formal_parameter)
<a9> DW_AT_abstract_origin: <0x38>
<ad> DW_AT_location : 2 byte block: 91 6c (DW_OP_fbreg: -20)
--------------------------------------------------------------------------------
GDB output is reversed then:
f (c=3, b=2, a=1) at 16.c:5
It was rejected as a GCC PR:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49828
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.