This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB 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 breakpoints/10738] New: Cannot set breakpoint on inlined function


Tested against: GNU gdb (GDB) Fedora (6.8.91.20090930-2.fc12)

Take the following program:

struct foo
{
  const int i;
  const long j;
};

typedef struct foo fooer;

static int
bar (const int i, const long j)
{
  return i * j;
}

static int
func (int (*f) ())
{
  const fooer baz = { .i = 2, .j = 21 };
  return f(baz.i, baz.j);
}

int
main (int argc, char *argv[], char *envp[])
{
  return func (&bar) - 42;
}

Compiled with gcc -g -O2 -o const const.c

(gdb) break func
Function "func" not defined.
Make breakpoint pending on future shared library load? (y or [n]) 

While it is possible to break on the function by line:

(gdb) break const.c:18
Breakpoint 1 at 0x400490: file const.c, line 18.

func is marked as inlined in the dwarf debuginfo:

 <1><71>: Abbrev Number: 8 (DW_TAG_subprogram)
    <72>   DW_AT_name        : (indirect string, offset: 0x0): func     
    <76>   DW_AT_decl_file   : 1        
    <77>   DW_AT_decl_line   : 16       
    <78>   DW_AT_prototyped  : 1        
    <79>   DW_AT_type        : <0x53>   
    <7d>   DW_AT_inline      : 1        (inlined)
    <7e>   DW_AT_sibling     : <0xa8>   
[...]
 <2><147>: Abbrev Number: 18 (DW_TAG_inlined_subroutine)
    <148>   DW_AT_abstract_origin: <0x71>       
    <14c>   DW_AT_low_pc      : 0x400490        
    <154>   DW_AT_high_pc     : 0x4004a4        
    <15c>   DW_AT_call_file   : 1       
    <15d>   DW_AT_call_line   : 25

-- 
           Summary: Cannot set breakpoint on inlined function
           Product: gdb
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: breakpoints
        AssignedTo: unassigned at sourceware dot org
        ReportedBy: mjw at redhat dot com
                CC: gdb-prs at sourceware dot org


http://sourceware.org/bugzilla/show_bug.cgi?id=10738

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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