This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Unexpected DW_AT_type for Ada strings on s390x?


Upstream gnat seems to create different debug data for string parameters
on s390x than on x86, x86_64 or s390.  On s390x the DW_AT_type of a
string parameter is a constant /reference/ to the two-element structure
"string___XUP".  On the other platforms it is the constant structure,
not a reference.

Due to this indirection the second "bt" in "lang_switch.exp" generates
unexpected output; gdb now shows the "msg" parameter with an address
like this:

     msg=@0x3ffffffdc48: {...}

The test case fails on s390x because of that.

Is the DW_AT_type output intentional?  Why does it depend on the
architecture?  Note that for C or C++, gcc correctly declares structure
parameters as /structures/ (not references) in their DW_AT_type.

If the output is intentional, I suggest to relax the pattern in the test
case accordingly.  In any case it would be nice to differentiate the two
"backtrace" test points, e.g. like this:


--- a/gdb/testsuite/gdb.ada/lang_switch.exp
+++ b/gdb/testsuite/gdb.ada/lang_switch.exp
@@ -43,5 +43,5 @@ gdb_test "bt" \
 gdb_test "set lang c"
 gdb_test "bt" \
          ".*#1.*lang_switch\\.ada_procedure\\s*\\(msg={.*\\).*" \
-         "backtrace"
+	 "backtrace (C)"


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]