This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

debug/10003: gcc -g mis-places low_pc of inlined functions


>Number:         10003
>Category:       debug
>Synopsis:       gcc -g mis-places low_pc of inlined functions
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Mar 08 14:26:01 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Werner Almesberger
>Release:        3.3 20030303 (prerelease)
>Organization:
>Environment:
System: Linux ar 2.4.18 #5 Mon Mar 18 09:25:24 ART 2002 i686 unknown
Architecture: i686

	
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ./configure --prefix=/usr/local/gcc20030303/ --enable-languages=c
>Description:
This one it pretty nasty: if we place a breakpoint at an inlined
function's low_pc, the arguments aren't even on the stack yet !

>How-To-Repeat:
Example (with Red Hat's gcc 3.1 20011127 on ia32):

$ cat <<EOF >foo.c
int xyz;

static inline int foo(int bar)
{
label:
        xyz = bar;
}

void main(int argc)
{
    foo(123);
}
EOF
$ gcc -w -g foo.c       # gcc 3.3: gcc -w -g -finline foo.c
$ readelf -w a.out
...
 <2><4a>: Abbrev Number: 4 (DW_TAG_inlined_subroutine)
     DW_AT_abstract_origin: <68>
     DW_AT_low_pc      : 0x80483a8 134513576
...
$ objdump -d a.out 
...
08048398 <main>:
...
 80483a6:       29 c4                   sub    %eax,%esp
 80483a8:       c7 45 fc 7b 00 00 00    movl   $0x7b,0xfffffffc(%ebp)
 80483af:       8b 45 fc                mov    0xfffffffc(%ebp),%eax
 80483b2:       a3 34 95 04 08          mov    %eax,0x8049534
 80483b7:       c9                      leave
...

>Fix:
Work-around: don't access arguments in inlined functions ?
>Release-Note:
>Audit-Trail:
>Unformatted:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]