Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Yao Qi <qiyaoltc@gmail.com>
To: gdb-patches@sourceware.org
Subject: [PATCH 2/3] Record right reg num of thumb special data instructions
Date: Mon, 22 Feb 2016 16:53:00 -0000	[thread overview]
Message-ID: <1456159999-5644-3-git-send-email-yao.qi@linaro.org> (raw)
In-Reply-To: <1456159999-5644-1-git-send-email-yao.qi@linaro.org>

When GDB decodes these thumb special data instructions, such as 'mov sp, r7'
the Rd is got incorrectly.  According to the arch reference manual, the Rd
is DN:Rdn, in which DN is bit 7 and Rdn is bits 0 to 2.  This patch fixes it.

gdb:

2016-02-22  Yao Qi  <yao.qi@linaro.org>

	* arm-tdep.c (thumb_record_ld_st_reg_offset): Fix the register
	number of Rd.
---
 gdb/arm-tdep.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index 1a3a209..0c0e1a5 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -11512,10 +11512,10 @@ thumb_record_ld_st_reg_offset (insn_decode_record *thumb_insn_r)
         }
       else
         {
-          /* Format 8; special data processing insns.  */
-          reg_src1 = bits (thumb_insn_r->arm_insn, 0, 2);
-          record_buf[0] = ARM_PS_REGNUM;
-          record_buf[1] = reg_src1;
+	  /* Format 8; special data processing insns.  */
+	  record_buf[0] = ARM_PS_REGNUM;
+	  record_buf[1] = (bit (thumb_insn_r->arm_insn, 7) << 3
+			   | bits (thumb_insn_r->arm_insn, 0, 2));
           thumb_insn_r->reg_rec_count = 2;
         }
     }
-- 
1.9.1


  parent reply	other threads:[~2016-02-22 16:53 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-22 16:53 [PATCH 0/3] Bug fixes in arm reverse debugging Yao Qi
2016-02-22 16:53 ` [PATCH 3/3] Fix various bugs in arm_record_exreg_ld_st_insn Yao Qi
2016-02-23 19:59   ` Luis Machado
2016-02-26 14:54     ` Yao Qi
2016-02-22 16:53 ` Yao Qi [this message]
2016-02-22 16:53 ` [PATCH 1/3] Generalize gdb.reverse/aarch64.exp Yao Qi
2016-02-24 11:22   ` Pedro Alves
2016-02-24 14:40     ` Yao Qi
2016-02-24 14:40       ` [PATCH 1.5/3] Rename gdb.reverse/aarch64.{exp,c} to gdb.reverse/insn-reverse.{exp,c} Yao Qi
2016-02-24 19:37       ` [PATCH 1/3] Generalize gdb.reverse/aarch64.exp Pedro Alves
2016-02-26 15:01 ` [PATCH 0/3] Bug fixes in arm reverse debugging 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=1456159999-5644-3-git-send-email-yao.qi@linaro.org \
    --to=qiyaoltc@gmail.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