+2015-02-06 Simon Marchi <simon.marchi@ericsson.com>
+
+ PR gdb/15678
+ * breakpoint.c (map_breakpoint_numbers): Check for empty args string.
+ (enable_count_command): Check args for NULL value.
+
2015-02-05 Doug Evans <xdje42@gmail.com>
* guile/scm-frame.c: Fix spelling errors in a comment.
int match;
struct get_number_or_range_state state;
- if (args == 0)
+ if (args == 0 || *args == '\0')
error_no_arg (_("one or more breakpoint numbers"));
init_number_or_range (&state, args);
static void
enable_count_command (char *args, int from_tty)
{
- int count = get_number (&args);
+ int count;
+
+ if (args == NULL)
+ error_no_arg (_("hit count"));
+
+ count = get_number (&args);
map_breakpoint_numbers (args, do_map_enable_count_breakpoint, &count);
}
+2015-02-06 Simon Marchi <simon.marchi@ericsson.com>
+
+ PR gdb/15678
+ * gdb.base/ena-dis-br.exp: Test "enable count" for bad user input.
+
2015-02-06 Pedro Alves <palves@redhat.com>
* gdb.threads/attach-many-short-lived-threads.c (SECONDS): New
set bp2 [break_at marker1 " line $bp_location15"]
+gdb_test "enable count" \
+ "Argument required \\(hit count\\)\\." \
+ "enable count missing arguments"
+
+gdb_test "enable count 2" \
+ "Argument required \\(one or more breakpoint numbers\\)\\." \
+ "enable count missing breakpoint number"
+
gdb_test_no_output "enable count 2 $bp" "disable break with count"
gdb_test "continue" \