Index: gdb/testsuite/gdb.dwarf2/dw2-icc-opaque.exp |
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-simple-locdesc.exp b/gdb/testsuite/gdb.dwarf2/dw2-icc-opaque.exp |
similarity index 52% |
copy from gdb/testsuite/gdb.dwarf2/dw2-simple-locdesc.exp |
copy to gdb/testsuite/gdb.dwarf2/dw2-icc-opaque.exp |
index 72a075c86e4d3125f2adfc6f9e2edde4e4623f1a..fe7d7e8e8c85e5f0d79b84805ceeff523c9e4228 100644 |
--- a/gdb/testsuite/gdb.dwarf2/dw2-simple-locdesc.exp |
+++ b/gdb/testsuite/gdb.dwarf2/dw2-icc-opaque.exp |
@@ -1,5 +1,5 @@ |
-# Copyright 2011-2012 Free Software Foundation, Inc. |
-# |
+# Copyright (C) 2011-2012 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 |
# the Free Software Foundation; either version 3 of the License, or |
@@ -14,15 +14,17 @@ |
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
load_lib dwarf.exp |
+# Test that we can correctly resolve opaque structures compiled by the Intel |
+# compiler, which does not set DW_AT_declaration on opaque structure types. |
+# This is GDB PR symtab/13277. |
+ |
# This test can only be run on targets which support DWARF-2 and use gas. |
if {![dwarf2_support]} { |
- return 0 |
+ return 0 |
} |
-set testfile "dw2-simple-locdesc" |
-set srcfile ${testfile}.S |
-set executable ${testfile}.x |
-set binfile ${objdir}/${subdir}/${executable} |
+standard_testfile .S |
+set executable ${testfile} |
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" object {}] != "" } { |
return -1 |
@@ -30,18 +32,14 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" object {}] != "" |
clean_restart $executable |
-# Re: [patch 2/2] Fix decode_locdesc for gcc-4.7.x optimized DWARF |
-# http://sourceware.org/ml/gdb-patches/2011-07/msg00766.html |
-set test "p &s.shl" |
-gdb_test_multiple $test $test { |
- -re " = \\(int \\*\\) 0x1000000\r\n$gdb_prompt $" { |
- pass $test |
- } |
- -re " = \\(int \\*\\) 0x14\r\n$gdb_prompt $" { |
- kfail "symtab/13307" $test |
- } |
+# Before PR 13277 was fixed, this would output: |
+# type = struct opaque_struct_t { |
+# <no data fields> |
+# } * |
+if { [istarget s390x-*-*] && [is_lp64_target] } { |
+ # The hand-coded DWARF info hard-codes a pointer size of 4 bytes, |
+ # which is represented as @mode32 on s390x. |
+ gdb_test "ptype p_struct" "type = struct opaque_struct_t {\r\n *int wrapped_value;\r\n} \\* @mode32" |
+} else { |
+ gdb_test "ptype p_struct" "type = struct opaque_struct_t {\r\n *int wrapped_value;\r\n} \\*" |
} |
- |
-# Re: RFC: fix DW_AT_data_member_location buglet |
-# http://sourceware.org/ml/gdb-patches/2011-05/msg00291.html |
-gdb_test "p &s.data4" { = \(int \*\) 0x10000} |