Unexpected DW_AT_type for Ada strings on s390x?
Joel Brobecker
brobecker@adacore.com
Tue Dec 4 12:11:00 GMT 2012
[Cc'ing Eric, as he is the compiler expert - GDB just represents what
the compiler tells us]
> 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.
My first guess is that the variantion in type definition is caused
by differences in ABI. I don't know s390 platforms, so I can't
confirm offhand. But it seems like a plausible way to pass the
argument.
If Eric confirms my guess, the attached patch should fix the problem.
[the rest of your email is kept below - as a reference for Eric, in case
he needs it]
> 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)"
--
Joel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-gdb.ada-lang_switch-Allow-msg-parameter-to-be-a-refe.patch
Type: text/x-diff
Size: 988 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb/attachments/20121204/0fa975f8/attachment.bin>
More information about the Gdb
mailing list