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 Sun, Sep 4, 2011 at 8:22 PM, Jan Kratochvil
<jan.kratochvil@redhat.com> wrote:
> On Sat, 03 Sep 2011 11:21:19 +0200, Abhijit Halder wrote:
>> >> + ? ?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.
>
> It is currently a common practice to match this kind of pattern just from
> ` = ' upwards such as:
> gdb_test "p callme ()" " = 42"
> etc. everywhere in the testsuite.
>
> But if you want to match the initial $number part such as in
> gdb_test "print test1.test" "\\$\[0-9\]* = true" "simple object, const bool"
> then it is more simple by:
> ? ?if ![regexp {^\$[0-9]+ = 120 'x'\n$} $fdata] then {
>
Got it. Correcting the same in the next patch.
>
> Thanks,
> Jan
>


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