The regex to detect the beginning of a test file execution was too broad, matching any line beginning with "Running ". This caused dg-extract-results.sh to truncate some test logs, including gdb.base/help.exp (which tests "help running", printing "Running the program.") The attached patch makes the match a little more precise to avoid this. With this the exact count of PASS/FAIL/etc lines in the dg-extract-results.sh output matches the counts in the computed summary exactly for all cases I've seen.