[PATCH][TEST-CASE][DOC] Implementation of pipe to pass GDB's command output to a shell command.
Jan Kratochvil
jan.kratochvil@redhat.com
Sun Sep 4 15:05:00 GMT 2011
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 {
Thanks,
Jan
More information about the Gdb-patches
mailing list