This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] add -s option to make -break-insert support dprintf
- From: Tom Tromey <tromey at redhat dot com>
- To: Hui Zhu <teawater at gmail dot com>
- Cc: Pedro Alves <palves at redhat dot com>, Eli Zaretskii <eliz at gnu dot org>, Hui Zhu <hui_zhu at mentor dot com>, gdb-patches ml <gdb-patches at sourceware dot org>, Marc Khouzam <marc dot khouzam at ericsson dot com>
- Date: Fri, 19 Apr 2013 13:56:56 -0600
- Subject: Re: [PATCH] add -s option to make -break-insert support dprintf
- References: <515451EA dot 1000200 at mentor dot com> <83y5d7wpvq dot fsf at gnu dot org> <CANFwon23qn_SVjcUWUZ2Z2Y5Euqg8efiwMvXkxTRtA9-2Ttk3Q at mail dot gmail dot com> <516454DA dot 9040109 at redhat dot com> <CANFwon1aDoyCYrsNeUpkmh6ARFJmT8B4JdFqYcc6GLdo=cgqig at mail dot gmail dot com> <87ppxzhfqy dot fsf at fleche dot redhat dot com> <CANFwon2_yT4SOpK7=Rq=91nFcvk2Rn3_wAkCMmsfgP-6iynGig at mail dot gmail dot com> <516C2549 dot 3060808 at redhat dot com> <CANFwon0WYLZEKWkfHzRgCB8MOPPoCsDvSaCk0SSYXPgonuE5zw at mail dot gmail dot com>
>>>>> "Hui" == Hui Zhu <teawater@gmail.com> writes:
Hui> The MI handle the argument is different with CLI. For example:
Hui> Input -break-insert -s "1\n" to mi. The mi_cmd_break_insert will get:
[...]
This seems to mean that extra quoting is needed for the format string.
Like you can't send just:
-break-insert -s "\"1\n\""
It seems like you have to send:
-break-insert -s "\"1\\n\""
But an alternative is to keep the MI interface simple and "MI-like" --
meaning using the quoting and argument parsing convention already
defined by MI, one of its big benefits over the CLI -- and let gdb
handle the requirements of the protocol and/or its own internals. That
is, send:
-break-insert -s "1\n"
... and gdb can rewrite that format string to whatever is needed.
Tom