aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.mi
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2013-04-08 14:09:30 +0000
committerPedro Alves <palves@redhat.com>2013-04-08 14:09:30 +0000
commitf6de8ec2620da62f46cb4e3887b981677cdd9cdb (patch)
treeb9a0d682130d2443d1a850a87384ee8f005b17f8 /gdb/testsuite/gdb.mi
parentf65ce5fb99ce664302abe4af1263fdbb0518d069 (diff)
downloadgdb-f6de8ec2620da62f46cb4e3887b981677cdd9cdb.zip
gdb-f6de8ec2620da62f46cb4e3887b981677cdd9cdb.tar.gz
gdb-f6de8ec2620da62f46cb4e3887b981677cdd9cdb.tar.bz2
create_breapoint / explicit mode: Error out if there's garbage after the breakpoint location.
If !PARSE_CONDITION_AND_THREAD, then ARG is just the location, nothing else. The fact that the describing comment of create_breakpoint doesn't mention this just looks like an oversight of when extra_string was added. "parse_condition_and_thread" has been a misnomer ever since extra_string was added -- better rename it avoid more confusion. This makes it "parse_arg", as that'll remain stable even if/when more explicit parameters are added. gdb/ 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". gdb/testsuite/ 2013-04-08 Pedro Alves <palves@redhat.com> * gdb.mi/mi-break.exp (test_error): Add tests with garbage after the location.
Diffstat (limited to 'gdb/testsuite/gdb.mi')
-rw-r--r--gdb/testsuite/gdb.mi/mi-break.exp12
1 files changed, 12 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.mi/mi-break.exp b/gdb/testsuite/gdb.mi/mi-break.exp
index 9cf0126..d5d58c7 100644
--- a/gdb/testsuite/gdb.mi/mi-break.exp
+++ b/gdb/testsuite/gdb.mi/mi-break.exp
@@ -196,6 +196,18 @@ proc test_error {} {
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 {} {