From: Andreas Arnez <arnez@linux.vnet.ibm.com>
To: Yao Qi <qiyaoltc@gmail.com>
Cc: gdb-patches@sourceware.org, Jan Kratochvil <jan.kratochvil@redhat.com>
Subject: Re: [PATCH] Big-endian targets: don't ignore offset into DW_OP_implicit_value
Date: Fri, 27 Jan 2017 19:35:00 -0000 [thread overview]
Message-ID: <m3r33othxf.fsf@oc1027705133.ibm.com> (raw)
In-Reply-To: <20170125221223.hsitc46wy462cb4b@localhost> (Yao Qi's message of "Wed, 25 Jan 2017 22:12:23 +0000")
On Wed, Jan 25 2017, Yao Qi wrote:
> On 17-01-12 20:24:27, Andreas Arnez wrote:
>> diff --git a/gdb/testsuite/gdb.dwarf2/dw2-op-stack-value.exp b/gdb/testsuite/gdb.dwarf2/dw2-op-stack-value.exp
>> index c28dcca..808f983 100644
>> --- a/gdb/testsuite/gdb.dwarf2/dw2-op-stack-value.exp
>> +++ b/gdb/testsuite/gdb.dwarf2/dw2-op-stack-value.exp
>> @@ -45,7 +45,7 @@ gdb_test_multiple $test $test {
>> -re ":\[ \t\]*0xaa551234\r\n$gdb_prompt $" {
>> # big endian
>> pass $test
>> - gdb_test "p/x implicit4to2" " = 0x3344"
>> + gdb_test "p/x implicit4to2" " = 0x1122"
>> gdb_test "p/x implicit4to4" " = 0x11223344"
>
> It takes me a while to understand this. I am wondering is it a valid
> test case? how does compiler generate a DIE for a 2-byte variable
> from a 4-byte implicit value.
AFAIK never. I don't know why a compiler should emit a larger immediate
value than necessary. So this is an artificial test.
> DWARF spec isn't clear on this case to me.
Right, DWARF does not specify this. Even so, we may want GDB to exhibit
defined behavior for such corner cases as well. I probably wouldn't
have added such a test, but I didn't want remove it either, because it
could be considered useful in the sense that it tests GDB's
"implementation-defined" behavior for this case.
> It has nothing to do with your patch, but I just raise this
> question when I read your patch.
>
>> +# Byte-aligned objects with simple location descriptions.
>> +switch $endian { big {set val 0x345678} little {set val 0x785634} }
>> +gdb_test "print/x def_implicit_s" " = \\{a = 0x12, b = $val\\}"
>> +gdb_test "print/x def_implicit_s.b" " = $val"
>> +gdb_test "print/x def_implicit_a" \
>> + " = \\{0x1, 0x12, 0x23, 0x34, 0x45, 0x56, 0x67, 0x78, 0x89\\}"
>
> All these values are from debug information rather than inferior memory,
> does it make sense to run these tests above with both big and little
> endianess?
I've tried, but I don't know to make it work. Switching to the opposite
endianness affects more than just the byte order of variable contents;
the variables are not even found any more. Any idea?
> Otherwise, patch is good to me.
Thanks!
--
Andreas
next prev parent reply other threads:[~2017-01-27 19:35 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-12 19:24 Andreas Arnez
2017-01-19 17:44 ` Yao Qi
2017-01-19 18:21 ` Andreas Arnez
2017-01-24 9:42 ` [PATCH 0/2] Add DW_OP_implicit_value in dwarf assembler Yao Qi
2017-01-24 9:43 ` [PATCH 1/2] Handle DW_OP_GNU_implicit_pointer " Yao Qi
2017-01-24 9:43 ` [PATCH 2/2] Use dwarf assembler in gdb.dwarf2/implptr-64bit.exp Yao Qi
2017-01-24 19:21 ` Andreas Arnez
2017-01-25 16:26 ` Yao Qi
2017-01-25 22:12 ` [PATCH] Big-endian targets: don't ignore offset into DW_OP_implicit_value Yao Qi
2017-01-27 19:35 ` Andreas Arnez [this message]
2017-02-01 9:09 ` Andreas Arnez
2017-02-01 9:16 ` Yao Qi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m3r33othxf.fsf@oc1027705133.ibm.com \
--to=arnez@linux.vnet.ibm.com \
--cc=gdb-patches@sourceware.org \
--cc=jan.kratochvil@redhat.com \
--cc=qiyaoltc@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox