2013-07-19 Hui Zhu <hui@codesourcery.com>
authorHui Zhu <teawater@gmail.com>
Fri, 19 Jul 2013 07:26:46 +0000 (07:26 +0000)
committerHui Zhu <teawater@gmail.com>
Fri, 19 Jul 2013 07:26:46 +0000 (07:26 +0000)
PR gdb/15692
* mi/mi-cmd-break.c (mi_argv_to_format): Handle double quotes.

2013-07-19  Hui Zhu  <hui@codesourcery.com>

PR gdb/15692
* gdb.mi/mi-dprintf.exp: Add double quotes test.

gdb/ChangeLog
gdb/mi/mi-cmd-break.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.mi/mi-dprintf.exp

index a95e05c4cf9515ed72e3e65315de78043f363125..89be305461b4ca53bf94a9c38341670430b504c0 100644 (file)
@@ -1,3 +1,8 @@
+2013-07-19  Hui Zhu  <hui@codesourcery.com>
+
+       PR gdb/15692
+       * mi/mi-cmd-break.c (mi_argv_to_format): Handle double quotes.
+
 2013-07-19  Yao Qi  <yao@codesourcery.com>
 
        * target.c (update_current_target): Change the default action
index 87ccee743f8131e3cd9181328c046b1c0eaf12f3..ab39989fd2efe8a9fef76cbfc2512123aa053a06 100644 (file)
@@ -128,6 +128,9 @@ mi_argv_to_format (char **argv, int argc)
        case '\v':
          obstack_grow (&obstack, "\\v", 2);
          break;
+       case '"':
+         obstack_grow (&obstack, "\\\"", 2);
+         break;
        default:
          if (isprint (argv[0][i]))
            obstack_grow (&obstack, argv[0] + i, 1);
index 77658adfc3daaeabf7c15c3cbb61ef7bbaf5c0b7..0056b2a58f1756fec440ce1efb93b58231355ebf 100644 (file)
@@ -1,3 +1,8 @@
+2013-07-19  Hui Zhu  <hui@codesourcery.com>
+
+       PR gdb/15692
+       * gdb.mi/mi-dprintf.exp: Add double quotes test.
+
 2013-07-19  Yao Qi  <yao@codesourcery.com>
 
        * gdb.trace/read-memory.exp (test_from_remote): Update test.
index 3509963b9212c1396377c0ebfa436e05f6e66406..812f14961bc6dba96be8b885e8d7458599f41e57 100644 (file)
@@ -48,7 +48,7 @@ mi_gdb_test "3-dprintf-insert 29" \
 mi_gdb_test "-break-insert main" ".*" "mi insert breakpoint main"
 mi_delete_breakpoints
 
-mi_gdb_test "4-dprintf-insert foo \"At foo entry\\n\"" \
+mi_gdb_test "4-dprintf-insert foo \"\\\"foobarbazqux\\\" At foo entry\\n\"" \
     "4\\^done,bkpt=\{number=\".*\",type=\"dprintf\".*func=\"foo\",file=\".*mi-dprintf.c\",fullname=\".*mi-dprintf.c\",line=\".*\".*" "mi insert dprintf foo"
 
 mi_gdb_test "5-dprintf-insert $dp_location1 \"arg=%d, g=%d\\n\" arg g" \
@@ -65,10 +65,16 @@ proc mi_continue_dprintf {args} {
     with_test_prefix $args {
        global mi_gdb_prompt
 
+       if { $args == "call" || $args == "fprintf" } {
+           set foobarbazqux "\"foobarbazqux\""
+       } else {
+           set foobarbazqux "\\\\\"foobarbazqux\\\\\""
+       }
+
        mi_run_cmd
        set msg "mi 1st dprintf"
        gdb_expect {
-            -re ".*At foo entry.*arg=1234, g=1234" {
+            -re ".*$foobarbazqux At foo entry.*arg=1234, g=1234" {
                pass $msg
            }
            -re ".*$mi_gdb_prompt$" {
@@ -83,7 +89,7 @@ proc mi_continue_dprintf {args} {
        set msg "mi 2nd dprintf"
        mi_send_resuming_command "exec-continue" "$msg continue"
        gdb_expect {
-            -re ".*At foo entry.*arg=1235, g=2222" {
+            -re ".*$foobarbazqux At foo entry.*arg=1235, g=2222" {
                pass $msg
            }
            -re ".*$mi_gdb_prompt$" {