From: Tom de Vries Date: Mon, 20 Jul 2020 09:19:51 +0000 (+0200) Subject: [gdb/testsuite] Fix valgrind-infcall-2.exp without libc debug info X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c06ad8b573d89511ec9c8bd33d3f3f55d404ed63;p=binutils-gdb.git [gdb/testsuite] Fix valgrind-infcall-2.exp without libc debug info When running test-case gdb.base/valgrind-infcall-2.exp on a system without libc debug info installed, I run into: ... (gdb) p printf ("bla")^M 'printf' has unknown return type; cast the call to its declared return type^M (gdb) FAIL: gdb.base/valgrind-infcall-2.exp: do printf ... Fix this by casting the result of the printf call to int. Tested on x86_64-linux. gdb/testsuite/ChangeLog: 2020-07-20 Tom de Vries * gdb.base/valgrind-infcall-2.exp: Handle printf unknown return type. --- diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 5b0a2dc77c9..045ac017457 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2020-07-20 Tom de Vries + + * gdb.base/valgrind-infcall-2.exp: Handle printf unknown return type. + 2020-07-20 Tom de Vries * gdb.threads/attach-slow-waitpid.exp: Bail out if gdb_start fails. diff --git a/gdb/testsuite/gdb.base/valgrind-infcall-2.exp b/gdb/testsuite/gdb.base/valgrind-infcall-2.exp index a3983f7564b..9d0a6f56a65 100644 --- a/gdb/testsuite/gdb.base/valgrind-infcall-2.exp +++ b/gdb/testsuite/gdb.base/valgrind-infcall-2.exp @@ -60,7 +60,7 @@ gdb_test_multiple "bt 1" "do printf" { # Thread status is VgTs_WaitSys # ' # (gdb) - gdb_test "p printf (\"bla\")" \ + gdb_test "p (int)printf (\"bla\")" \ "can only be accepted if the thread is .*" \ $gdb_test_name }