This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Fix mi-pending.exp on remote targets
- From: Vladimir Prus <vladimir at codesourcery dot com>
- To: gdb-patches at sourceware dot org
- Date: Thu, 31 Jul 2008 11:41:33 +0400
- Subject: Fix mi-pending.exp on remote targets
The mi-pending.exp test presently fails on remote targets. It's because it uses
gdb_load_shlibs function. On non-remote target, that one returns immediately, and
on remote target it does:
gdb_test "set solib-search-path [file dirname [lindex $args 0]]" "" ""
which clearly does not work in MI. This patch introduces new function specifically for MI,
and make mi-pending.exp use that. Checked in.
- Volodya
Index: gdb/testsuite/ChangeLog
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/ChangeLog,v
retrieving revision 1.1693
diff -u -p -r1.1693 ChangeLog
--- gdb/testsuite/ChangeLog 30 Jul 2008 17:08:45 -0000 1.1693
+++ gdb/testsuite/ChangeLog 31 Jul 2008 07:37:21 -0000
@@ -1,3 +1,8 @@
+2008-07-31 Vladimir Prus <vladimir@codesourcery.com>
+
+ * lib/mi-support.exp (mi_load_shlibs): New.
+ * gdb.mi/mi-pending.exp: Use mi_load_shlibs, not gdb_load_shlibs.
+
2008-07-30 Vladimir Prus <vladimir@codesourcery.com>
* lib/mi-support.exp (get_mi_thread_list)
Index: gdb/testsuite/gdb.mi/mi-pending.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-pending.exp,v
retrieving revision 1.6
diff -u -p -r1.6 mi-pending.exp
--- gdb/testsuite/gdb.mi/mi-pending.exp 24 Apr 2008 08:46:19 -0000 1.6
+++ gdb/testsuite/gdb.mi/mi-pending.exp 31 Jul 2008 07:37:21 -0000
@@ -56,7 +56,7 @@ gdb_exit
mi_gdb_start
mi_gdb_reinitialize_dir $srcdir/$subdir
mi_gdb_load ${binfile}
-gdb_load_shlibs $lib_sl
+mi_load_shlibs $lib_sl
if [target_info exists gdb_stub] {
gdb_step_for_stub;
Index: gdb/testsuite/lib/mi-support.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/lib/mi-support.exp,v
retrieving revision 1.68
diff -u -p -r1.68 mi-support.exp
--- gdb/testsuite/lib/mi-support.exp 30 Jul 2008 17:08:45 -0000 1.68
+++ gdb/testsuite/lib/mi-support.exp 31 Jul 2008 07:37:21 -0000
@@ -1681,3 +1681,18 @@ proc check_mi_and_console_threads {name}
}
}
}
+
+proc mi_load_shlibs { args } {
+ if {![is_remote target]} {
+ return
+ }
+
+ foreach file $args {
+ gdb_download $file
+ }
+
+ # Even if the target supplies full paths for shared libraries,
+ # they may not be paths for this system.
+ mi_gdb_test "set solib-search-path [file dirname [lindex $args 0]]" "\^done" ""
+}
+