summaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base/break.exp
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2008-03-21 15:33:11 +0000
committerDaniel Jacobowitz <drow@false.org>2008-03-21 15:33:11 +0000
commit6214f497d3f1800171978839ef029f712369e2f9 (patch)
treeaf177c71d56a8b1a91799e3891ca8e7719631ce0 /gdb/testsuite/gdb.base/break.exp
parent6309237547d076d68daaf8f4d0cd55c5964e1411 (diff)
downloadbinutils-gdb-6214f497d3f1800171978839ef029f712369e2f9.tar.gz
2008-03-21 Chris Demetriou <cgd@google.com>
* symtab.c (rbreak_command): Quote symbol name before passing it to break_command. * gdb.base/break.exp (rbreak junk): New test for rbreak "Junk at end of arguments" issue.
Diffstat (limited to 'gdb/testsuite/gdb.base/break.exp')
-rw-r--r--gdb/testsuite/gdb.base/break.exp42
1 files changed, 42 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.base/break.exp b/gdb/testsuite/gdb.base/break.exp
index 0ec70c92dce..2e042ddd1b2 100644
--- a/gdb/testsuite/gdb.base/break.exp
+++ b/gdb/testsuite/gdb.base/break.exp
@@ -944,6 +944,48 @@ gdb_expect {
}
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+if [target_info exists gdb_stub] {
+ gdb_step_for_stub;
+}
+
+#
+# test that 'rbreak' on a symbol that may be from a shared library doesn't
+# cause a "Junk at end of arguments." error.
+#
+# On x86 GNU/Linux, this test will choke on e.g. __libc_start_main@plt.
+#
+# Note that this test won't necessarily choke on all targets even if
+# all the rbreak issue is present. rbreak needs to match and set a
+# breakpoint on a symbol causes 'break' to choke.
+#
+
+gdb_test "set breakpoint pending on" "" "rbreak junk pending setup"
+
+# We expect at least one breakpoint to be set when we "rbreak main".
+gdb_test "rbreak main" \
+ ".*Breakpoint.*at.* file .*$srcfile, line.*" \
+ "rbreak junk set breakpoint"
+
+# Run to a breakpoint. Fail if we see "Junk at end of arguments".
+gdb_run_cmd
+gdb_expect {
+ -re "Junk at end of arguments" {
+ fail "rbreak junk"
+ }
+ -re ".*Breakpoint \[0-9\]+,.*$gdb_prompt $" {
+ pass "rbreak junk"
+ }
+ timeout {
+ fail "rbreak junk (timeout)"
+ }
+}
+
+
# Reset the default arguments for VxWorks
if [istarget "*-*-vxworks*"] {
set timeout 10