This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]