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 gdb/15645] New: Setting a breakpoint in a function marked with __attribute__((always_inline)) with multiple locations only sets it at the first location


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

            Bug ID: 15645
           Summary: Setting a breakpoint in a function marked with
                    __attribute__((always_inline)) with multiple locations
                    only sets it at the first location
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: simon.marchi at ericsson dot com

Created attachment 7084
  --> http://sourceware.org/bugzilla/attachment.cgi?id=7084&action=edit
Snippet to reproduce

Steps to reproduce (see attached file):

$ gcc inline.c -g
$ gdb ./a.out
Reading symbols from /home/simark/a.out...done.
(gdb) break 5
Breakpoint 1 at 0x40053b: file inline.c, line 5.
(gdb) break func
Note: breakpoint 1 also set at pc 0x40053b.
Breakpoint 2 at 0x40053b: func. (3 locations)
(gdb) quit

The function "func" is forced to be inline, and therefore its body appears 3
times directly in the main. The command "break 5" only sets a breakpoint at the
first of these locations. The expected result is that it sets a breakpoint at
all 3 locations.

Note that doing "break func" puts a breakpoint in all 3 locations.

>From what I saw, when it is a function that is inlined but without
((always_inline)), the behaviour is correct.

Maybe related, the output of "info breakpoints" is not ideal.

1       breakpoint     keep y   <MULTIPLE>         
1.1                         y     0x000000000040053b in main at inline.c:5
1.2                         y     0x0000000000400556 <main+42>
1.3                         y     0x0000000000400571 <main+69>

For locations 2 and 3, we have <main+X>, but it should be similar to location
1, "in main at inline.c:5.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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