This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Multiple breakpoint locations
Nick Roberts wrote:
>
> The new code for breakpoints with multiple locations looks very good and
> addresses a common complaint about GDB. I have a couple of points and
> apologise if they have already been discussed.
>
> Folowing the example in the manual:
>
> Num Type Disp Enb Address What
> 1 breakpoint keep y <MULTIPLE>
> stop only if i==1
> breakpoint already hit 1 time
> 1.1 y 0x080486a2 in void foo<int>() at
> t.cc:8
> 1.2 y 0x080486ca in void foo<double>() at
> t.cc:8
>
>
> 1) I can enable/disable 1.1 and 1.2 but not delete them:
>
> (gdb) dis 1.1
>
> Num Type Disp Enb Address What
> 1 breakpoint keep y <MULTIPLE>
> stop only if i==1
> breakpoint already hit 1 time
> 1.1 n 0x080486a2 in void foo<int>() at
> t.cc:8
> 1.2 y 0x080486ca in void foo<double>() at
> t.cc:8
>
> (gdb) d 1.1
> warning: bad breakpoint number at or near '1.1'
Well, you can't really delete a location -- if breakpoint expression
corresponds to 20 addresses, that's the way it is -- you cannot delete
some of those addresses from the program ;-)
> 2) I can enable/disable 1 and this appears to enable/disable all the
> locations.
> Perhap this could be documented in the manual.
Well yes. Patches welcome ;-)
> 3) I created this breakpoint by specifying the line but if I do:
>
> b foo<int>()
>
> or any variant I can think of, I just get a pending breakpoint as GDB
> doesn't recognise the location. Can such locations be specified on the
> command line by name?
Does
b 'void foo<int>()'
work better?
- Volodya