[PATCH] Fix PR 15692 -dprintf-insert does not accept double quotes

Hui Zhu teawater@gmail.com
Thu Jul 18 12:58:00 GMT 2013


On Thu, Jul 11, 2013 at 1:02 AM, Tom Tromey <tromey@redhat.com> wrote:
>>>>>> "Hui" == Hui Zhu <teawater@gmail.com> writes:
>
> Hui> +  if { $args == "call" || $args == "fprintf" } {
> Hui> +      set foobarbazqux "\"foobarbazqux\""
> Hui> +  } else {
> Hui> +      set foobarbazqux "\\\\\"foobarbazqux\\\\\""
> Hui> +  }
>
> Why are different regexps needed for these cases?
> I thought the output was supposed to be the same in all situations.

With "call" or "fprintf".
The dprintf is directly outputted by inferior.  So the string is:
"foobarbazqux" At foo entry

But with others, the dprintf is outputted by GDB.  So the string is:
~"\"foobarbazqux\" At foo entry\n"

That is why I use different $foobarbazqux.

Thanks,
Hui

>
> Other than this issue the patch is ok.
>
> Tom



More information about the Gdb-patches mailing list