aboutsummaryrefslogtreecommitdiff
path: root/gdb/doc/gdb.texinfo
diff options
context:
space:
mode:
authorXavier Roirand <roirand@adacore.com>2017-11-07 11:00:31 +0000
committerPedro Alves <palves@redhat.com>2017-11-07 11:00:31 +0000
commitd0fe47010fc3289e081ba547a0bfcc6d07906cd2 (patch)
treecb255e0b04bb0b1e4d43bce583ca2938e08f4b7d /gdb/doc/gdb.texinfo
parent0198d5e6fc331d50dc19b7f250ac4bc510a8dbb5 (diff)
downloadgdb-d0fe47010fc3289e081ba547a0bfcc6d07906cd2.zip
gdb-d0fe47010fc3289e081ba547a0bfcc6d07906cd2.tar.gz
gdb-d0fe47010fc3289e081ba547a0bfcc6d07906cd2.tar.bz2
Allow enabling/disabling breakpoint location ranges
When a breakpoint has multiple locations, like e.g.: Num Type Disp Enb Address What 1 breakpoint keep y <MULTIPLE> 1.1 y 0x080486a2 in void foo<int>()... 1.2 y 0x080486ca in void foo<double>()... [....] 1.5 y 0x080487fa in void foo<long>()... it's possible to enable/disable the individual locations using the '<breakpoint_number>.<location_number>' syntax, like e.g.: (gdb) disable 1.2 1.3 1.4 1.5 That's inconvenient when you have a long list of locations to disable, however. This patch adds shorthand for the above, by making it possible to specify a range of locations with the following syntax (similar to thread id ranges): <breakpoint_number>.<first_location_number>-<last_location_number> For example, the command above can now be simplified to: (gdb) disable 1.2-5 gdb/ChangeLog: 2017-11-07 Xavier Roirand <roirand@adacore.com> Pedro Alves <palves@redhat.com> * breakpoint.c (map_breakpoint_number_range): New, factored out from ... (map_breakpoint_numbers): ... here. (find_location_by_number): Change parameters from string to breakpoint number and location. (extract_bp_number_and_location): New function. (enable_disable_bp_num_loc) (enable_disable_breakpoint_location_range) (enable_disable_command): New functions, factored out ... (enable_command, disable_command): ... these functions, and adjusted to support ranges. * NEWS: Document enable/disable breakpoint location range feature. gdb/doc/ChangeLog: 2017-11-07 Xavier Roirand <roirand@adacore.com> Pedro Alves <palves@redhat.com> * gdb.texinfo (Set Breaks): Document support for breakpoint location ranges in the enable/disable commands. gdb/testsuite/ChangeLog: 2017-11-07 Xavier Roirand <roirand@adacore.com> Pedro Alves <palves@redhat.com> * gdb.base/ena-dis-br.exp: Add reference to gdb.cp/ena-dis-br-range.exp. * gdb.cp/ena-dis-br-range.exp: New file. * gdb.cp/ena-dis-br-range.cc: New file.
Diffstat (limited to 'gdb/doc/gdb.texinfo')
-rw-r--r--gdb/doc/gdb.texinfo18
1 files changed, 10 insertions, 8 deletions
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index bfeb7a9..29d4789 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -3927,15 +3927,17 @@ Num Type Disp Enb Address What
1.2 y 0x080486ca in void foo<double>() at t.cc:8
@end smallexample
-Each location can be individually enabled or disabled by passing
+You cannot delete the individual locations from a breakpoint. However,
+each location can be individually enabled or disabled by passing
@var{breakpoint-number}.@var{location-number} as argument to the
-@code{enable} and @code{disable} commands. Note that you cannot
-delete the individual locations from the list, you can only delete the
-entire list of locations that belong to their parent breakpoint (with
-the @kbd{delete @var{num}} command, where @var{num} is the number of
-the parent breakpoint, 1 in the above example). Disabling or enabling
-the parent breakpoint (@pxref{Disabling}) affects all of the locations
-that belong to that breakpoint.
+@code{enable} and @code{disable} commands. It's also possible to
+@code{enable} and @code{disable} a range of @var{location-number}
+locations using a @var{breakpoint-number} and two @var{location-number}s,
+in increasing order, separated by a hyphen, like
+@kbd{@var{breakpoint-number}.@var{location-number1}-@var{location-number2}},
+in which case @value{GDBN} acts on all the locations in the range (inclusive).
+Disabling or enabling the parent breakpoint (@pxref{Disabling}) affects
+all of the locations that belong to that breakpoint.
@cindex pending breakpoints
It's quite common to have a breakpoint inside a shared library.