Bug 149125 - FEAT: Gdb can't set break point at inlined function
FEAT: Gdb can't set break point at inlined function
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: gdb (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jan Kratochvil
Fedora Extras Quality Assurance
: FutureFeature
: 149126 (view as bug list)
Depends On:
Blocks: 418441
  Show dependency treegraph
 
Reported: 2005-02-18 18:18 EST by H.J. Lu
Modified: 2016-03-21 15:11 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-03-21 15:11:18 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
A testcase (462 bytes, application/octet-stream)
2005-04-22 16:02 EDT, H.J. Lu
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
Sourceware 10738 None None None Never

  None (edit)
Description H.J. Lu 2005-02-18 18:18:46 EST
When I tried to debug the linker from default binutils build, I got

(gdb) b map_sections_to_segments
Function "map_sections_to_segments" not defined.

From readelf -w, I see

<1><a7e8>: Abbrev Number: 75 (DW_TAG_subprogram)
     DW_AT_sibling     : <a97e>
     DW_AT_name        : (indirect string, offset: 0x6801):
map_sections_to_segments
     DW_AT_decl_file   : 1
     DW_AT_decl_line   : 3405
     DW_AT_prototyped  : 1
     DW_AT_type        : <942>
     DW_AT_inline      : 1      (inlined)

The line number looks right. Gdb should be able to figure something
out.
Comment 1 H.J. Lu 2005-04-22 15:54:39 EDT
FYI, Intel't idb has no problem with it.
Comment 2 H.J. Lu 2005-04-22 16:02:09 EDT
Created attachment 113572 [details]
A testcase

[hjl@gnu-10 inline]$ make
/usr/gcc-4.0/bin/gcc -O2 -g -o x x.c
[hjl@gnu-10 inline]$ gdb x
GNU gdb 6.3.0.20050201-cvs
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...Using host libthread_db
library "/lib/tls/libthread_db.so.1".

(gdb) b foo
Function "foo" not defined.
Make breakpoint pending on future shared library load? (y or [n]) n
(gdb) q
[hjl@gnu-10 inline]$ /opt/intel/idb80/bin/idb -gdb x
Linux Application Debugger for 32-bit applications, Version 8.1-7, Build
20050128
------------------
object file name: x
Reading symbols from /export/home/hjl/bugs/gcc/debug/inline/x...done.
(idb) b foo
Breakpoint 1 at 0x8048371: file x.c, line 11.
(idb) r
Starting program: /export/home/hjl/bugs/gcc/debug/inline/x

Breakpoint 1, foo (x=Info: symbol x is defined but not allocated (optimized
away)
<no value>) at x.c:11
11	      printf ("%d\n", y);
(idb) bt
#0  0x08048371 in inlined foo (x=Info: symbol x is defined but not allocated
(optimized away)
<no value>) at x.c:11
#1	       in main () at x.c:27
#2  0x4e11be33 in __libc_start_main () in /lib/tls/libc-2.3.4.so
#3  0x080482e1 in _start () in /export/home/hjl/bugs/gcc/debug/inline/x
(idb)
Comment 3 Jan Kratochvil 2007-01-01 21:00:43 EST
Confirming this feature is not present, neither in upstream CVS:

dwarf2read.c: process_die ():
    case DW_TAG_inlined_subroutine:
      /* FIXME:  These are ignored for now.
         They could be used to set breakpoints on all inlined instances
         of a function and make GDB `next' properly over inlined functions.  */
      break;
Comment 4 Jan Kratochvil 2007-01-01 21:05:10 EST
*** Bug 149126 has been marked as a duplicate of this bug. ***
Comment 5 Andrew Cagney 2007-12-10 13:38:13 EST
This is an upstream problem; close the bug with category "UPSTREAM".
Comment 7 Fedora Admin XMLRPC Client 2011-01-05 22:21:58 EST
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 8 Jay Turner 2011-02-15 10:21:20 EST
Just a tad over 3 years . . . can this be closed out or should it be re-prioritized for recent Fedora development?
Comment 9 Jan Kratochvil 2011-02-15 10:26:26 EST
It is still a valid Bug, it is occasionally discussed as one of the next TODO items.
Comment 11 Jan Kratochvil 2016-03-21 15:11:18 EDT
(gdb) b foo
Breakpoint 1 at 0x400444: file x.c, line 11.
(gdb) r
Starting program: /tmp/foodir/x 
Breakpoint 1, main () at x.c:30
30	  i = foo (1);
(gdb) bt
#0  main () at x.c:30
(gdb) p/x $pc
$1 = 0x400444
(gdb) step
foo (x=1) at x.c:11
11	      printf ("%d\n", y);
(gdb) p/x $pc
$2 = 0x400444
(gdb) bt
#0  foo (x=1) at x.c:11
#1  main () at x.c:30
(gdb) 

Fixed by Gary Benson in 2012

Note You need to log in before you can comment on or make changes to this bug.