[committed][gdb/testsuite] Fix valgrind-infcall-2.exp without libc debug info

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[committed][gdb/testsuite] Fix valgrind-infcall-2.exp without libc debug info

Tom de Vries
Hi,

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.

Committed to trunk.

Thanks,
- Tom

[gdb/testsuite] Fix valgrind-infcall-2.exp without libc debug info

gdb/testsuite/ChangeLog:

2020-07-20  Tom de Vries  <[hidden email]>

        * gdb.base/valgrind-infcall-2.exp: Handle printf unknown return type.

---
 gdb/testsuite/gdb.base/valgrind-infcall-2.exp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/testsuite/gdb.base/valgrind-infcall-2.exp b/gdb/testsuite/gdb.base/valgrind-infcall-2.exp
index a3983f7564..9d0a6f56a6 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
     }