aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/testsuite/gdb.dwarf2/dw2-using-debug-str.exp12
1 files changed, 12 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-using-debug-str.exp b/gdb/testsuite/gdb.dwarf2/dw2-using-debug-str.exp
index 762ff02..c45d631 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-using-debug-str.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-using-debug-str.exp
@@ -98,6 +98,18 @@ if ![runto_main] {
# field names, all of which are stored in the .debug_str section.
gdb_test "p global_var" " = \\{aa = 0, bb = 0, cc = 0\\}"
+# If we have a .gdb_index already, this test isn't going to work,
+# because the .gdb_index reader doesn't check for .debug_str.
+if {[get_index_type $testfile] == "gdb"} {
+ untested ".gdb_index does not handle this case"
+ return
+}
+
+# objcopy, even with --dump-section, will try to open the executable
+# for writing. To avoid "text file busy", exit gdb here, stopping the
+# inferior as a side effect.
+gdb_exit
+
set host_binfile [gdb_remote_download host $binfile]
# Verify that the executable actually contains a .debug_str section, before