From: Luis Machado Date: Thu, 27 Aug 2015 04:49:05 +0000 (-0300) Subject: Force language to C in gdb.compile/compile-ifunc.exp X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8ce74153537add5e364865518a72194ab58b3dbc;p=binutils-gdb.git Force language to C in gdb.compile/compile-ifunc.exp Due to the lack of debug information in the binary, GDB is unable to figure out what language is being used. This may be a problem when doing remote debugging and the binary stops at the entry point containing asm code. In this case GDB will switch to asm as current language and will not switch back to C when it reaches main, which in turn causes the compile feature check to malfunction. This is solved by forcing the language to C after reaching main. gdb/testsuite/ChangeLog: 2015-08-26 Luis Machado * gdb.compile/compile-ifunc.exp (with_test_prefix): Force language to C. --- diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 5bba9d7305e..7b271e2b8c0 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-08-26 Luis Machado + + * gdb.compile/compile-ifunc.exp (with_test_prefix): Force language + to C. + 2015-08-26 Patrick Palka * gdb.base/run-after-attach.exp: New test file. diff --git a/gdb/testsuite/gdb.compile/compile-ifunc.exp b/gdb/testsuite/gdb.compile/compile-ifunc.exp index 026c62f69a8..3a96552b6ef 100644 --- a/gdb/testsuite/gdb.compile/compile-ifunc.exp +++ b/gdb/testsuite/gdb.compile/compile-ifunc.exp @@ -25,6 +25,12 @@ with_test_prefix "nodebug" { return -1 } + # This binary has no debug information, so force the language to C in case + # GDB happened to see real asm code when it stopped at the entry point + # when talking to a remote target, like gdbserver. This guarantees the + # feature check below will work. + gdb_test_no_output "set language c" "" + if {[skip_compile_feature_tests]} { untested "compile command not supported (could not find libcc1 shared library?)" return -1