summaryrefslogtreecommitdiff
path: root/gdb/breakpoint.c
diff options
context:
space:
mode:
authormwaqas <mwaqas>2013-08-23 06:22:09 +0000
committermwaqas <mwaqas>2013-08-23 06:22:09 +0000
commitb890ed92fb4f010e5b843faf049a7827a0b826e6 (patch)
tree9a98a502d13089ce7f177cd46068b7c19416c372 /gdb/breakpoint.c
parentb47f30e2b43887c9ff363bf7db10c51a68437765 (diff)
downloadgdb-b890ed92fb4f010e5b843faf049a7827a0b826e6.tar.gz
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.c72
1 files changed, 46 insertions, 26 deletions
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 3b75bc49846..44bb7a844f7 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