Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Hui Zhu <teawater@gmail.com>
To: Yao Qi <yao@codesourcery.com>
Cc: gdb-patches ml <gdb-patches@sourceware.org>
Subject: Re: [PATCH] Fix PR 15692 -dprintf-insert does not accept double quotes
Date: Wed, 03 Jul 2013 08:42:00 -0000	[thread overview]
Message-ID: <CANFwon34nGekzdhGMA4=-0_1n_5CQ2jnxeq8bo8SjLU5e4wP-g@mail.gmail.com> (raw)
In-Reply-To: <51D2E749.9020604@codesourcery.com>

[-- Attachment #1: Type: text/plain, Size: 1013 bytes --]

On Tue, Jul 2, 2013 at 10:44 PM, Yao Qi <yao@codesourcery.com> wrote:
> On 07/02/2013 09:30 PM, Hui Zhu wrote:
>>
>> --- a/gdb/mi/mi-cmd-break.c
>> +++ b/gdb/mi/mi-cmd-break.c
>> @@ -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);
>
>
> IWBN to add a test case to show that GDB handles double quotes correctly
> after this fix.

Hi Yao,

Thanks for your remind.

Post a new patch about test this issue.

Best,
Hui

>
> --
> Yao (齐尧)

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

	PR gdb/15692
	mi/mi-cmd-break.c (mi_argv_to_format): Handle double quotes.

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

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

[-- Attachment #2: dprintf-mi-handle-quotes.txt --]
[-- Type: text/plain, Size: 331 bytes --]

--- a/gdb/mi/mi-cmd-break.c
+++ b/gdb/mi/mi-cmd-break.c
@@ -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);

[-- Attachment #3: dprintf-mi-handle-quotes-test.txt --]
[-- Type: text/plain, Size: 1211 bytes --]

--- a/gdb/testsuite/gdb.mi/mi-dprintf.exp
+++ b/gdb/testsuite/gdb.mi/mi-dprintf.exp
@@ -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" \
@@ -68,7 +68,7 @@ proc mi_continue_dprintf {args} {
 	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 +83,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$" {

  reply	other threads:[~2013-07-03  8:42 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-02 13:31 Hui Zhu
2013-07-02 14:44 ` Yao Qi
2013-07-03  8:42   ` Hui Zhu [this message]
2013-07-03 10:55     ` Yao Qi
2013-07-03 12:03       ` Hui Zhu
2013-07-03 13:09         ` Yao Qi
2013-07-07  5:54           ` Hui Zhu
2013-07-10 17:03             ` Tom Tromey
2013-07-18 12:58               ` Hui Zhu
2013-07-18 13:42                 ` Tom Tromey
2013-07-19  7:29                   ` Hui Zhu
2013-07-23 19:04                     ` Tom Tromey
2013-07-24  1:56                       ` Hui Zhu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CANFwon34nGekzdhGMA4=-0_1n_5CQ2jnxeq8bo8SjLU5e4wP-g@mail.gmail.com' \
    --to=teawater@gmail.com \
    --cc=gdb-patches@sourceware.org \
    --cc=yao@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox