For review: call-ar-st.exp: don't fail on slow targets

Jimmy Guo guo@cup.hp.com
Thu Jun 24 20:17:00 GMT 1999


Andrew,

The problem you encountered with fast responses seems to be related to
what I'd call the improper use of gdb_expect_list proc -- the proc is
fine, but one of the patterns in the pattern list needs to be adjusted
to work with expect.

In your original change, in the 2nd pattern, you need to remove the
trailing \[ \t\r\n\]+ RE.  Otherwise, on a fast system expect will see
all the blanks / newlines leading to 0.000000 (part of the the 3rd
pattern), and consume these.  When expect tries to match the 3rd
pattern, there's no leading blanks / newlines to match against!

I've tried your routine w/ a simple perl script acting as gdb (echos the
content below for print*, or just gdb prompt for anything else except
cont* which causes it to exit), and it works for me everytime after this
fix -- I think this experiment is good enough to emulate a fast
system :)

- Jimmy Guo, guo@cup.hp.com

!   gdb_expect_list "print print_double_array(double_array)" ".*$gdb_prompt $"
{
!       "\[ \t\r\n\]+array_d :"
!       "\[ \t\r\n\]+=========\[ \t\r\n\]+"
!       "\[ \t\r\n\]+0.000000"
!       "\[ \t\r\n\]+23.456700  46.913400  70.370100  93.826800 117.283500 
140.740200  164.196900  187.653600"
!       "\[ \t\r\n\]+211.110300  234.567000  258.023700  281.480400 304.937100 
328.393800  351.850500  375.307200"
!       "\[ \t\r\n\]+398.763900  422.220600  445.677300  469.134000 492.590700 
516.047400  539.504100  562.960800"
!       "\[ \t\r\n\]+586.417500  609.874200  633.330900  656.787600 680.244300 
703.701000  727.157700  750.614400"
!       "\[ \t\r\n\]+774.071100  797.527800  820.984500  844.441200 867.897900 
891.354600  914.811300  938.268000"
!       "\[ \t\r\n\]+961.724700  985.181400  1008.638100  1032.094800  1055.551500  1079.008200  1102.464900  1125.921600"
!       "\[ \t\r\n\]+1149.378300  1172.835000  1196.291700  1219.748400  1243.205100  1266.661800  1290.118500  1313.575200"
!       "\[ \t\r\n\]+1337.031900  1360.488600  1383.945300  1407.402000 1430.858700  1454.315400  1477.772100  1501.228800"
!       "\[ \t\r\n\]+1524.685500  1548.142200  1571.598900  1595.055600 1618.512300  1641.969000  1665.425700  1688.882400"
!       "\[ \t\r\n\]+1712.339100  1735.795800  1759.252500  1782.709200 1806.165900  1829.622600  1853.079300  1876.536000"
!       "\[ \t\r\n\]+1899.992700  1923.449400  1946.906100  1970.362800 1993.819500  2017.276200  2040.732900  2064.189600"
!       "\[ \t\r\n\]+2087.646300  2111.103000  2134.559700  2158.016400 2181.473100  2204.929800  2228.386500  2251.843200"
!       "\[ \t\r\n\]+2275.299900  2298.756600  2322.213300\[ \t\r\n\]+\[\t\r\n\]+"



More information about the Gdb mailing list