public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug breakpoints/10738] New: Cannot set breakpoint on inlined function
@ 2009-10-06 11:39 mjw at redhat dot com
  0 siblings, 0 replies; only message in thread
From: mjw at redhat dot com @ 2009-10-06 11:39 UTC (permalink / raw)
  To: gdb-prs

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.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-10-06 11:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-06 11:39 [Bug breakpoints/10738] New: Cannot set breakpoint on inlined function mjw at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).