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

Hui Zhu
2013-07-18T12:58:15Z

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