This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH][TEST-CASE][DOC] Implementation of pipe to pass GDB's command output to a shell command.
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Abhijit Halder <abhijit dot k dot halder at gmail dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Fri, 2 Sep 2011 22:44:54 +0200
- Subject: Re: [PATCH][TEST-CASE][DOC] Implementation of pipe to pass GDB's command output to a shell command.
- References: <CAOhZP9wR64nEfvJgtv=1Nby+7mpCavrxsXfUWG+SaeJMO2ynJA@mail.gmail.com>
On Wed, 31 Aug 2011 17:09:30 +0200, Abhijit Halder wrote:
> --- src/gdb/pipe.c 2011-07-29 15:15:26.078048517 +0530
> +++ dst/gdb/pipe.c 2011-08-29 18:50:14.000000000 +0530
[...]
> +#if defined(__MINGW32__)
->
+#if defined (__MINGW32__)
Not GNU Coding Style compliant although it is so common in GDB I do not mind
(already commented before).
> +# define SHELL "cmd.exe"
> +# define OPTION_TO_SHELL "/c"
> +#else
> +# define SHELL "/bin/sh"
> +# define OPTION_TO_SHELL "-c"
> +#endif
[...]
> --- src/gdb/testsuite/gdb.base/pipe.exp 2011-08-16 22:37:45.969351119 +0530
> +++ dst/gdb/testsuite/gdb.base/pipe.exp 2011-08-25 03:10:05.000000000 +0530
> @@ -0,0 +1,52 @@
[...]
> + regsub -all {\$[0-9]+} $fdata {} pattern
> + if ![string match $pattern " = 120 'x'\n"] then {
Instead of regsub + string match just:
if ![string match "* = 120 'x'\n" $fdata] then {
You have opposite order of the pattern vs. string in the `string match'
otherwise.
> + fail $test
> + } else {
> + pass $test
> + }
> +}