Index: gdb/testsuite/gdb.linespec/macro-relative.exp |
diff --git a/gdb/testsuite/gdb.dwarf2/pr10770.exp b/gdb/testsuite/gdb.linespec/macro-relative.exp |
similarity index 51% |
copy from gdb/testsuite/gdb.dwarf2/pr10770.exp |
copy to gdb/testsuite/gdb.linespec/macro-relative.exp |
index 4c60b163f80258f02bc2cfcf5b191811d317b1fd..0a056e3b043ef9dbd4a918ff459bee306135f496 100644 |
--- a/gdb/testsuite/gdb.dwarf2/pr10770.exp |
+++ b/gdb/testsuite/gdb.linespec/macro-relative.exp |
@@ -1,4 +1,4 @@ |
-# Copyright 2010-2012 Free Software Foundation, Inc. |
+# Copyright 2013 Free Software Foundation, Inc. |
# This program is free software; you can redistribute it and/or modify |
# it under the terms of the GNU General Public License as published by |
@@ -13,31 +13,35 @@ |
# You should have received a copy of the GNU General Public License |
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
-# Test DW_OP_call_frame_cfa. |
- |
standard_testfile |
-if {[prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}]} { |
- return 0 |
-} |
+set opts {debug additional_flags=-I.} |
-# This test can only be run on targets which use GCC. |
get_compiler_info |
-if {![test_compiler_info "gcc-*"]} { |
- return 0 |
+if [test_compiler_info gcc*] { |
+ lappend opts additional_flags=-g3 |
} |
-if {![runto_main]} { |
+if { [file pathtype $objdir] == "relative" } { |
+ untested "objdir $objdir should be absolute" |
+ return |
+} |
+set saved_pwd [pwd] |
+cd $srcdir/${subdir}/base/two |
+set err [gdb_compile "../../${srcfile}" "${binfile}" executable $opts] |
+cd $saved_pwd |
+if { $err != "" } { |
+ untested "compilation failed" |
return -1 |
} |
-# This test also requires DWARF 2. |
-get_debug_format |
-if {![test_debug_format "DWARF 2"]} { |
+clean_restart ${testfile} |
+ |
+# Test macros respect DW_AT_comp_dir. |
+ |
+# "list header_two_func" does not set exactly the one line we want. |
+if ![runto header_two_func] { |
return -1 |
} |
-gdb_test "break force_unwind" "Breakpoint .*" "set breakpoint for pr10770" |
-gdb_test "cont" "Breakpoint ., force_unwind .*" |
-# If we have the bug, this will hang. |
-gdb_test "frame 2" "#2 .* callme .*" |
+gdb_test "info macro HEADER" "\r\n#define HEADER 2" |