Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Yao Qi <qiyaoltc@gmail.com>
To: gdb-patches@sourceware.org
Cc: arnez@linux.vnet.ibm.com
Subject: [PATCH 1/2] Handle DW_OP_GNU_implicit_pointer in dwarf assembler
Date: Tue, 24 Jan 2017 09:43:00 -0000	[thread overview]
Message-ID: <1485250945-17594-2-git-send-email-yao.qi@linaro.org> (raw)
In-Reply-To: <1485250945-17594-1-git-send-email-yao.qi@linaro.org>

DW_OP_GNU_implicit_pointer refers to a DIE with an offset of different
sizes in different dwarf versions.  In v2, the size is the pointer size,
while in v3 and above, it is the ref_addr size.  This patch fixes
dwarf assembler to emit the correct size of offset.  We've already fixed
this size issue in gdb,
https://sourceware.org/ml/gdb-patches/2011-09/msg00451.html

gdb/testsuite:

2017-01-24  Yao Qi  <yao.qi@linaro.org>

	* lib/dwarf.exp (Dwarf::_location): Handle
	DW_OP_GNU_implicit_pointer with proper size.
---
 gdb/testsuite/lib/dwarf.exp | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/gdb/testsuite/lib/dwarf.exp b/gdb/testsuite/lib/dwarf.exp
index f7e4236..1883c86 100644
--- a/gdb/testsuite/lib/dwarf.exp
+++ b/gdb/testsuite/lib/dwarf.exp
@@ -845,6 +845,7 @@ namespace eval Dwarf {
     proc _location {body} {
 	variable _constants
 	variable _cu_label
+	variable _cu_version
 	variable _cu_addr_size
 	variable _cu_offset_size
 
@@ -918,7 +919,11 @@ namespace eval Dwarf {
 
 		    # Here label is a section offset.
 		    set label [lindex $line 1]
-		    _op .${_cu_offset_size}byte $label
+		    if { $_cu_version == 2 } {
+			_op .${_cu_addr_size}byte $label
+		    } else {
+			_op .${_cu_offset_size}byte $label
+		    }
 		    _op .sleb128 [lindex $line 2]
 		}
 
-- 
1.9.1


  reply	other threads:[~2017-01-24  9:42 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-12 19:24 [PATCH] Big-endian targets: don't ignore offset into DW_OP_implicit_value 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       ` Yao Qi [this message]
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
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=1485250945-17594-2-git-send-email-yao.qi@linaro.org \
    --to=qiyaoltc@gmail.com \
    --cc=arnez@linux.vnet.ibm.com \
    --cc=gdb-patches@sourceware.org \
    /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