public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "vries at gcc dot gnu.org" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug tdep/31278] [gdb/tdep, thumb2] GDB on arm-linux-gnueabihf fails gdb.reverse/func-map-to-same-line.exp
Date: Mon, 12 Feb 2024 11:27:18 +0000	[thread overview]
Message-ID: <bug-31278-4717-AxwIdJKu9m@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-31278-4717@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=31278

--- Comment #10 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Luis Machado from comment #9)
> I'm guessing this is probably LDR (immediate) T4 encoding Post Indexed, with
> a write-back that is not being accounted for in gdb.
> 

Thanks, it is indeed, this helped me find the encoding documentation.

> The write-back bit seems to be bit 8. Does it show up as 1 for your case?
> 

Yes.

> It was probably an oversight, as we can that being handled in
> thumb_stack_frame_destroyed_p:
> 
>   else if (insn == 0xf85d  /* ldr.w <Rt>, [sp], #4 */
>            && (insn2 & 0x0fff) == 0x0b04)
>     found_stack_adjust = 1;

OK, so how about this:
...
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index 861d50a6a3b..081e934cf86 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -14184,6 +14184,14 @@ thumb2_record_ld_word (arm_insn_decode_record
*thumb2_insn_r)
   record_buf[1] = ARM_PS_REGNUM;
   thumb2_insn_r->reg_rec_count = 2;

+  if ((thumb2_insn_r->arm_insn & 0xfff00900) == 0xf8500900)
+    {
+      /* Detected LDR(immediate), T4, with write-back bit set.  Record Rn
+        update.  */
+      record_buf[2] = bits (thumb2_insn_r->arm_insn, 16, 19);
+      thumb2_insn_r->reg_rec_count++;
+    }
+
   REG_ALLOC (thumb2_insn_r->arm_regs, thumb2_insn_r->reg_rec_count,
            record_buf);
   return ARM_RECORD_SUCCESS;
...

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  parent reply	other threads:[~2024-02-12 11:27 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-22 23:11 [Bug tdep/31278] New: " thiago.bauermann at linaro dot org
2024-01-23 10:18 ` [Bug tdep/31278] " vries at gcc dot gnu.org
2024-01-24  3:07 ` thiago.bauermann at linaro dot org
2024-01-25 14:30 ` vries at gcc dot gnu.org
2024-02-08 14:24 ` luis.machado at arm dot com
2024-02-09 13:01 ` vries at gcc dot gnu.org
2024-02-09 16:19 ` vries at gcc dot gnu.org
2024-02-11 11:58 ` vries at gcc dot gnu.org
2024-02-11 12:19 ` [Bug tdep/31278] [gdb/tdep, thumb2] " vries at gcc dot gnu.org
2024-02-11 13:10 ` vries at gcc dot gnu.org
2024-02-12  9:39 ` luis.machado at arm dot com
2024-02-12 11:27 ` vries at gcc dot gnu.org [this message]
2024-02-12 12:03 ` luis.machado at arm dot com
2024-02-12 14:11 ` vries at gcc dot gnu.org
2024-02-13  8:10 ` cvs-commit at gcc dot gnu.org
2024-02-13  8:13 ` vries at gcc dot gnu.org

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=bug-31278-4717-AxwIdJKu9m@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).