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][TEST-CASE][DOC] Implementation of pipe to pass GDB's command output to a shell command.


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
> +    }
> +}


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