Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Yao Qi <qiyaoltc@gmail.com>
To: Andreas Arnez <arnez@linux.vnet.ibm.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: Wed, 25 Jan 2017 22:12:00 -0000	[thread overview]
Message-ID: <20170125221223.hsitc46wy462cb4b@localhost> (raw)
In-Reply-To: <m3o9zcgjys.fsf@oc1027705133.ibm.com>

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.  DWARF spec isn't clear on this case to
me.  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?

Otherwise, patch is good to me.

-- 
Yao 


  parent reply	other threads:[~2017-01-25 22:12 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 ` Yao Qi [this message]
2017-01-27 19:35   ` [PATCH] Big-endian targets: don't ignore offset into DW_OP_implicit_value Andreas Arnez
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=20170125221223.hsitc46wy462cb4b@localhost \
    --to=qiyaoltc@gmail.com \
    --cc=arnez@linux.vnet.ibm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@redhat.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