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 Sat, Sep 3, 2011 at 2:14 AM, Jan Kratochvil
<jan.kratochvil@redhat.com> wrote:
> 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__)
>
Sorry somehow I missed this. I will correct this.
> 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 {
>
The intention was to eliminate only numeric patterns here.
Instead if I used "if ![string match "* = 120 'x'\n" $fdata] then {"
following pattern will also match:
$junk = 120 'x'
that I did not want.
> You have opposite order of the pattern vs. string in the `string match'
> otherwise.
>
>
>> + ? ? fail $test
>> + ? ?} else {
>> + ? ? pass $test
>> + ? ?}
>> +}
>
>

Thanks,
Abhijit Halder


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