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

Re: [PATCH] Use containing function when reporting breakpoint location.


On 03/21/2017 06:24 PM, Keith Seitz wrote:

> As far as this bug is concerned, this patch should be considered rejected/withdrawn.

I think we should step back a bit and understand / discuss what the goal
of "info breakpoints" in this scenario is, and make sure everyone ends up in
the same page.

What would the user ideally see?   What information is important for users when
they look at the breakpoint list?

For inlined breakpoints locations, I think it's also important to consider
the case of the code being expanded at multiple sites, resulting in
potentially many locations.

One of the main advantages of showing the multiple breakpoint
locations to the user is to let the user conveniently enable/disable
each location individually.  For example, with:

 (gdb) b foo::overload1arg
 2       breakpoint     keep y   <MULTIPLE>         
 2.1                         y     0x00000000004009b8 in foo::overload1arg() 
                                       at src/gdb/testsuite/gdb.cp/ovldbreak.cc:107
 2.2                         y     0x00000000004009cd in foo::overload1arg(char)
                                       at src/gdb/testsuite/gdb.cp/ovldbreak.cc:110
 2.3                         y     0x00000000004009e5 in foo::overload1arg(signed char) 
                                       at src/gdb/testsuite/gdb.cp/ovldbreak.cc:113
 2.4                         y     0x00000000004009fd in foo::overload1arg(unsigned char)
                                       at src/gdb/testsuite/gdb.cp/ovldbreak.cc:116
 2.5                         y     0x0000000000400a16 in foo::overload1arg(short) 
                                       at src/gdb/testsuite/gdb.cp/ovldbreak.cc:119
 2.6                         y     0x0000000000400a32 in foo::overload1arg(unsigned short)
                                       at src/gdb/testsuite/gdb.cp/ovldbreak.cc:122
 2.7                         y     0x0000000000400a4b in foo::overload1arg(int) 
                                       at src/gdb/testsuite/gdb.cp/ovldbreak.cc:125
 2.8                         y     0x0000000000400a65 in foo::overload1arg(unsigned int) 
                                       at src/gdb/testsuite/gdb.cp/ovldbreak.cc:128
 2.9                         y     0x0000000000400a80 in foo::overload1arg(long) 
                                       at src/gdb/testsuite/gdb.cp/ovldbreak.cc:131
 2.10                        y     0x0000000000400a9c in foo::overload1arg(unsigned long) 
                                       at src/gdb/testsuite/gdb.cp/ovldbreak.cc:134
 2.11                        y     0x0000000000400ab9 in foo::overload1arg(float) 
                                       at src/gdb/testsuite/gdb.cp/ovldbreak.cc:137
 2.12                        y     0x0000000000400ad7 in foo::overload1arg(double) 
                                       at src/gdb/testsuite/gdb.cp/ovldbreak.cc:140

Above, it's easy to disable the location for the "(long)" overload, for example.
Or at least, it's doable with the given information, because each method's
prototype is shown.

But if a user sets a breakpoint at an inline function, and then gets back this:

(gdb) inf br
Num     Type           Disp Enb Address            What
1       breakpoint     keep y   <MULTIPLE>    
1.1       breakpoint     keep y   0x0000000000400434 in inline_func at test.c:5
1.2       breakpoint     keep y   0x0000000000404534 in inline_func at test.c:5
1.3       breakpoint     keep y   0x0000000000405404 in inline_func at test.c:5
1.4       breakpoint     keep y   0x0000000000402345 in inline_func at test.c:5
1.5       breakpoint     keep y   0x0000000000435554 in inline_func at test.c:5
1.6       breakpoint     keep y   0x0000000000556566 in inline_func at test.c:5
...
...
1.70      breakpoint     keep y   0x0000000000645454 in inline_func at test.c:5

then I don't know what can the user do to quickly distinguish each of
the locations.  I would think that ideally a user would want to be able to 
quickly figure out from this output where each inline expansion occurred, in order
to be able to conveniently disable a location for a particular inline
expansion site, for being a non-interesting location that triggers
all too often, for example.

So I'd imagine something like this would be more helpful:

(gdb) inf br
Num     Type           Disp Enb Address            What
1       breakpoint     keep y   <MULTIPLE>    
1.1     breakpoint     keep y   0x0000000000400434 in inline_func at test.c:5
1.2     breakpoint     keep y   0x0000000000404534 in inline_func at test.c:5
                                  inlined in foo at foo.c:1020
1.3     breakpoint     keep y   0x0000000000404534 in inline_func at test.c:5
                                  inlined in bar at bar.c:1020
...

I.e., the first location is the out of line copy, and other two are
inline expansions.

Thanks,
Pedro Alves


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