Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Linn | ecom GmbH <j.linn@ecom.de>
To: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: [PATCH] gdb, m68hc11: fix for 68HC12 banked memory model
Date: Thu, 19 Nov 2026 16:04:35 +0000	[thread overview]
Message-ID: <5fbef3b4-7117-439b-a870-aed245091455@ecom.de> (raw)
In-Reply-To: <>


Fix gdb crash with E_M68HC12_BANKS set in the ELF header when reading
PC from target:

   regcache.c:810: internal-error: cooked_read: Assertion
   `regnum >= 0 && regnum < m_descr->nr_cooked_registers' failed.

Fix use_page_register(). Looks like a copy/paste error.

Signed-off-by: Joel Linn <j.linn@ecom.de>
---
  gdb/m68hc11-tdep.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gdb/m68hc11-tdep.c b/gdb/m68hc11-tdep.c
index 5389fee9..ded70944 100644
--- a/gdb/m68hc11-tdep.c
+++ b/gdb/m68hc11-tdep.c
@@ -120,7 +120,7 @@ enum insn_return_kind {
  #define M68HC11_REG_SIZE    (2)
   #define M68HC12_NUM_REGS        (9)
-#define M68HC12_NUM_PSEUDO_REGS ((M68HC11_MAX_SOFT_REGS+5)+1-1)
+#define M68HC12_NUM_PSEUDO_REGS ((M68HC11_MAX_SOFT_REGS+5)+1)
  #define M68HC12_HARD_PC_REGNUM  (SOFT_D32_REGNUM+1)
   struct insn_sequence;
@@ -154,7 +154,7 @@ static int
  use_page_register (gdbarch *arch)
  {
    m68gc11_gdbarch_tdep *tdep = gdbarch_tdep<m68gc11_gdbarch_tdep> (arch);
-  return tdep->stack_correction;
+  return tdep->use_page_register;
  }
   struct m68hc11_unwind_cache
-- 
2.56.1


                 reply	other threads:[~2026-11-19 16:05 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=5fbef3b4-7117-439b-a870-aed245091455@ecom.de \
    --to=j.linn@ecom.de \
    --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