This is the mail archive of the gcc-bugs@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]

[Bug middle-end/10003] gcc -g mis-places low_pc of inlined functions


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10003



------- Additional Comments From carlo at alinoe dot com  2003-09-20 17:04 -------
Werner,

can you please give some feedback on the following?

You write: "if we place a breakpoint at an inlined
function's low_pc, the arguments aren't even on the
stack yet!".  But, this is how it should be - the
readelf output you give shows a DW_TAG_inlined_subroutine
and the low_pc for that should be set at the very start
of the function (include the prologue of the function).

After fixing PR 12319, which certainly needs to be fixed
before this PR can be fixed (if at all needed), I get
the following for your code:

08048314 <main>:
 8048314:       55                      push   %ebp
 8048315:       89 e5                   mov    %esp,%ebp
 8048317:       83 ec 08                sub    $0x8,%esp
 804831a:       83 e4 f0                and    $0xfffffff0,%esp
 804831d:       b8 00 00 00 00          mov    $0x0,%eax
 8048322:       29 c4                   sub    %eax,%esp
 8048324:       c7 45 fc 7b 00 00 00    movl   $0x7b,0xfffffffc(%ebp)
 804832b:       8b 45 fc                mov    0xfffffffc(%ebp),%eax
 804832e:       a3 04 95 04 08          mov    %eax,0x8049504
 8048333:       c9                      leave
 8048334:       c3                      ret

 <2><a56>: Abbrev Number: 4 (DW_TAG_inlined_subroutine)
     DW_AT_abstract_origin: <a87>    (this is 'foo')
     DW_AT_low_pc      : 0x8048324 134513444
     DW_AT_high_pc     : 0x8048333 134513459

and that is correct.
Further I see:

 <2><aa3>: Abbrev Number: 11 (DW_TAG_label)
     DW_AT_name        : label
     DW_AT_decl_file   : 1
     DW_AT_decl_line   : 5
 <4><a74>: Abbrev Number: 7 (DW_TAG_label)
     DW_AT_abstract_origin: <aa3>
     DW_AT_low_pc      : 0x804832b 134513451

And 0x804832b is *after* the prologue, also ok thus.

I fail to set a breakpoint on 'label' with gdb though
nor do I seem to be able to print 'bar' at any instruction
with gdb. But that is a problem of gdb, not of the DWARF2
info generated with gcc.

Don't you think that when PR 12319 is fixed, this PR can be
closed too?


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