From: Tom de Vries Date: Fri, 8 Aug 2025 10:57:01 +0000 (+0200) Subject: [gdb/testsuite] Fix gdb.base/exprs.exp for gdb build with byacc X-Git-Tag: gdb-17-branchpoint~358 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2e0582e017a326be147c837102a122e13ae91ba3;p=thirdparty%2Fbinutils-gdb.git [gdb/testsuite] Fix gdb.base/exprs.exp for gdb build with byacc On x86_64-freebsd, with test-case gdb.base/exprs.exp I get: ... (gdb) print 23 yydebug: state 0, reading 257 (INT) yydebug: state 0, shifting to state 1 yydebug: state 1, reducing by rule 94 (exp : INT) yydebug: after reduction, shifting from state 0 to state 59 yydebug: state 59, reading 0 (end-of-file) yydebug: state 59, reducing by rule 7 (exp1 : exp) yydebug: after reduction, shifting from state 0 to state 60 yydebug: state 60, reducing by rule 1 (start : exp1) yydebug: after reduction, shifting from state 0 to state 58 $220 = 23 (gdb) FAIL: gdb.base/exprs.exp: print with debugging ... The test fails because it's not finding the string "Starting parse". In this case, the .y files are processed used byacc. I suppose the testcase matches the case that bison is used. Fix this by grepping for something more generic: shift or Shift. Tested on x86_64-linux and x86_64-freebsd. --- diff --git a/gdb/testsuite/gdb.base/exprs.exp b/gdb/testsuite/gdb.base/exprs.exp index f703c18a836..81f6f197cc4 100644 --- a/gdb/testsuite/gdb.base/exprs.exp +++ b/gdb/testsuite/gdb.base/exprs.exp @@ -285,11 +285,14 @@ gdb_test "print v_short + " \ gdb_test "print v_short =}{= 3" \ "A syntax error in expression, near `\\}\\{= 3'\\." +set hs {[^\r\n]} +set re_debug [string cat $hs* {[Ss]hift} $hs*] + gdb_test_no_output "set debug parse 1" set saw_start 0 set saw_val 0 gdb_test_multiple "print 23" "print with debugging" -lbl { - -re "\r\nStarting parse(?=\r\n)" { + -re "\r\n${re_debug}(?=\r\n)" { set saw_start 1 exp_continue }