diff options
author | Muhammad Waqas <mwaqas@sourceware.org> | 2013-08-23 06:22:10 +0000 |
---|---|---|
committer | Muhammad Waqas <mwaqas@sourceware.org> | 2013-08-23 06:22:10 +0000 |
commit | 9eaabc7557aef5ca4f68daed3ab0c3f5a664a020 (patch) | |
tree | b5c841370f4398520793f5dfccf56da4679abb65 /gdb/breakpoint.c | |
parent | 101158d99a92eb10c71d4cf3a07d9ac887f68bfb (diff) | |
download | gdb-9eaabc7557aef5ca4f68daed3ab0c3f5a664a020.zip gdb-9eaabc7557aef5ca4f68daed3ab0c3f5a664a020.tar.gz gdb-9eaabc7557aef5ca4f68daed3ab0c3f5a664a020.tar.bz2 |
2013-08-12 Muhammad Waqas <mwaqas@codesourcery.com>
PR gdb/15501
* breakpoint.c (enable_command, disable_command): Iterate over
all specified breakpoint locations.
2013-07-12 Muhammad Waqas <mwaqas@codesourccery.com>
PR gdb/15501
* gdb.base/ena-dis-br.exp: Add test to verify
enable/disable commands work correctly with
multiple arguments that include multiple locations.
Diffstat (limited to 'gdb/breakpoint.c')
-rw-r--r-- | gdb/breakpoint.c | 72 |
1 files changed, 46 insertions, 26 deletions
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 3b75bc4..44bb7a8 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -14553,25 +14553,35 @@ disable_command (char *args, int from_tty) if (user_breakpoint_p (bpt)) disable_breakpoint (bpt); } - else if (strchr (args, '.')) + else { - struct bp_location *loc = find_location_by_number (args); - if (loc) + char *num = extract_arg (&args); + + while (num) { - if (loc->enabled) + if (strchr (num, '.')) { - loc->enabled = 0; - mark_breakpoint_location_modified (loc); + struct bp_location *loc = find_location_by_number (num); + + if (loc) + { + if (loc->enabled) + { + loc->enabled = 0; + mark_breakpoint_location_modified (loc); + } + if (target_supports_enable_disable_tracepoint () + && current_trace_status ()->running && loc->owner + && is_tracepoint (loc->owner)) + target_disable_tracepoint (loc); + } + update_global_location_list (0); } - if (target_supports_enable_disable_tracepoint () - && current_trace_status ()->running && loc->owner - && is_tracepoint (loc->owner)) - target_disable_tracepoint (loc); + else + map_breakpoint_numbers (num, do_map_disable_breakpoint, NULL); + num = extract_arg (&args); } - update_global_location_list (0); } - else - map_breakpoint_numbers (args, do_map_disable_breakpoint, NULL); } static void @@ -14677,25 +14687,35 @@ enable_command (char *args, int from_tty) if (user_breakpoint_p (bpt)) enable_breakpoint (bpt); } - else if (strchr (args, '.')) + else { - struct bp_location *loc = find_location_by_number (args); - if (loc) + char *num = extract_arg (&args); + + while (num) { - if (!loc->enabled) + if (strchr (num, '.')) { - loc->enabled = 1; - mark_breakpoint_location_modified (loc); + struct bp_location *loc = find_location_by_number (num); + + if (loc) + { + if (!loc->enabled) + { + loc->enabled = 1; + mark_breakpoint_location_modified (loc); + } + if (target_supports_enable_disable_tracepoint () + && current_trace_status ()->running && loc->owner + && is_tracepoint (loc->owner)) + target_enable_tracepoint (loc); + } + update_global_location_list (1); } - if (target_supports_enable_disable_tracepoint () - && current_trace_status ()->running && loc->owner - && is_tracepoint (loc->owner)) - target_enable_tracepoint (loc); + else + map_breakpoint_numbers (num, do_map_enable_breakpoint, NULL); + num = extract_arg (&args); } - update_global_location_list (1); } - else - map_breakpoint_numbers (args, do_map_enable_breakpoint, NULL); } /* This struct packages up disposition data for application to multiple |