2008-03-21 Chris Demetriou <cgd@google.com>
authorDaniel Jacobowitz <drow@false.org>
Fri, 21 Mar 2008 15:33:11 +0000 (15:33 +0000)
committerDaniel Jacobowitz <drow@false.org>
Fri, 21 Mar 2008 15:33:11 +0000 (15:33 +0000)
        * 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.

gdb/ChangeLog
gdb/symtab.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/break.exp

index b56a87e0268182e03fda72b3144356f955a2a840..ef83262464554a430b0b9d2fefdf0c0d0f9f3e18 100644 (file)
@@ -1,3 +1,8 @@
+2008-03-21  Chris Demetriou  <cgd@google.com>
+
+       * symtab.c (rbreak_command): Quote symbol name before passing
+       it to break_command.
+
 2008-03-21  Daniel Jacobowitz  <dan@codesourcery.com>
 
        * eval.c (evaluate_subexp_for_address): Clarify error message.
index 40e31dc45da638b90787f1fba64b4ad23972601b..ddd2310165dd365e3a12609c6b2e223384f6419f 100644 (file)
@@ -3345,7 +3345,13 @@ rbreak_command (char *regexp, int from_tty)
        }
       else
        {
-         break_command (SYMBOL_LINKAGE_NAME (p->msymbol), from_tty);
+         char *string = alloca (strlen (SYMBOL_LINKAGE_NAME (p->msymbol))
+                                + 3);
+         strcpy (string, "'");
+         strcat (string, SYMBOL_LINKAGE_NAME (p->msymbol));
+         strcat (string, "'");
+
+         break_command (string, from_tty);
          printf_filtered ("<function, no debug info> %s;\n",
                           SYMBOL_PRINT_NAME (p->msymbol));
        }
index 0438144fb8751f1d866f1ede237ad6f04732acda..d72ef2b2d84c721f4192e4a5c8b815ef1562acbf 100644 (file)
@@ -1,3 +1,8 @@
+2008-03-21  Chris Demetriou  <cgd@google.com>
+
+       * gdb.base/break.exp (rbreak junk): New test for rbreak
+       "Junk at end of arguments" issue.
+
 2008-03-21  Daniel Jacobowitz  <dan@codesourcery.com>
 
        * gdb.base/printcmds.exp (test_print_array_constants): Do not expect
index 0ec70c92dced121996ca21f2eab02a860d5c394c..2e042ddd1b2e582eb3d2ea12818e5faffdb2d69b 100644 (file)
@@ -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
This page took 0.043251 seconds and 4 git commands to generate.