+2013-04-08 Pedro Alves <palves@redhat.com>
+ Keith Seitz <keiths@redhat.com>
+
+ * breakpoint.c (create_breakpoint): Rename
+ "parse_condition_and_thread" parameter to "parse_arg". Update
+ describing comment. If !PARSE_ARG, then error out if ARG is not
+ the empty string after extracting the location.
+ * breakpoint.h (create_breakpoint): Rename
+ "parse_condition_and_thread" parameter to "parse_arg".
+
2013-04-08 Aleksandar Ristovski <aristovski@qnx.com
* solib-svr4.c (lm_addr_check): Add const qualifier to 'so' arg.
/* Set a breakpoint. This function is shared between CLI and MI
functions for setting a breakpoint. This function has two major
- modes of operations, selected by the PARSE_CONDITION_AND_THREAD
- parameter. If non-zero, the function will parse arg, extracting
- breakpoint location, address and thread. Otherwise, ARG is just
- the location of breakpoint, with condition and thread specified by
- the COND_STRING and THREAD parameters. If INTERNAL is non-zero,
- the breakpoint number will be allocated from the internal
- breakpoint count. Returns true if any breakpoint was created;
- false otherwise. */
+ modes of operations, selected by the PARSE_ARG parameter. If
+ non-zero, the function will parse ARG, extracting location,
+ condition, thread and extra string. Otherwise, ARG is just the
+ breakpoint's location, with condition, thread, and extra string
+ specified by the COND_STRING, THREAD and EXTRA_STRING parameters.
+ If INTERNAL is non-zero, the breakpoint number will be allocated
+ from the internal breakpoint count. Returns true if any breakpoint
+ was created; false otherwise. */
int
create_breakpoint (struct gdbarch *gdbarch,
char *arg, char *cond_string,
int thread, char *extra_string,
- int parse_condition_and_thread,
+ int parse_arg,
int tempflag, enum bptype type_wanted,
int ignore_count,
enum auto_boolean pending_break_support,
lsal = VEC_index (linespec_sals, canonical.sals, 0);
- if (parse_condition_and_thread)
+ if (parse_arg)
{
char *rest;
/* Here we only parse 'arg' to separate condition
}
else
{
+ if (*arg != '\0')
+ error (_("Garbage '%s' at end of location"), arg);
+
/* Create a private copy of condition string. */
if (cond_string)
{
init_raw_breakpoint_without_location (b, gdbarch, type_wanted, ops);
b->addr_string = copy_arg;
- if (parse_condition_and_thread)
+ if (parse_arg)
b->cond_string = NULL;
else
{
mi_gdb_test "-var-update *" \
"\\^done,changelist=\\\[\\\]" \
"update varobj for function call"
+
+ # Try setting breakpoints with garbage after the location.
+
+ # "if" only works in the CLI. It's not supposed to be accepted by
+ # MI. The way to specify a condition is with -c.
+ mi_gdb_test "-break-insert \"callme if i < 4\"" \
+ ".*\\^error,msg=\"Garbage 'if i < 4' at end of location\"" \
+ "breakpoint with garbage after location"
+
+ mi_gdb_test "-break-insert -c i==4 \"callme if i < 4\"" \
+ ".*\\^error,msg=\"Garbage 'if i < 4' at end of location\"" \
+ "conditional breakpoint with garbage after location"
}
proc test_disabled_creation {} {