[pushed,gdb/testsuite] Fix gdb.cp/breakpoint-shlib-func.exp with remote-gdbserver-on-localhost

Message ID 20230307101124.14410-1-tdevries@suse.de
State Committed
Commit a50a8e305d4406d96adb5b2967236d7b8767997f
Headers
Series [pushed,gdb/testsuite] Fix gdb.cp/breakpoint-shlib-func.exp with remote-gdbserver-on-localhost |

Commit Message

Tom de Vries March 7, 2023, 10:11 a.m. UTC
  Test-case gdb.cp/breakpoint-shlib-func.exp fails with target board
remote-gdbserver-on-localhost.

Fix this by adding the missing gdb_load_shlib.

Tested on x86_64-linux.
---
 gdb/testsuite/gdb.cp/breakpoint-shlib-func.exp | 2 ++
 1 file changed, 2 insertions(+)


base-commit: e8850b52624245a1d7b8ef9fc41abb6175ec74e4
  

Patch

diff --git a/gdb/testsuite/gdb.cp/breakpoint-shlib-func.exp b/gdb/testsuite/gdb.cp/breakpoint-shlib-func.exp
index dc7c4a8a8ea..3745bfbd952 100644
--- a/gdb/testsuite/gdb.cp/breakpoint-shlib-func.exp
+++ b/gdb/testsuite/gdb.cp/breakpoint-shlib-func.exp
@@ -40,6 +40,8 @@  if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
     return -1
 }
 
+gdb_load_shlib $libobj
+
 # Place the breakpoint before the shared library has been loaded, the
 # breakpoint should be placed on the @plt symbol.
 gdb_test "break foo" "Breakpoint $decimal at $hex"