Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] gdb, m68hc11: fix for 68HC12 banked memory model
@ 2026-11-19 16:04 Joel Linn | ecom GmbH
  0 siblings, 0 replies; only message in thread
From: Joel Linn | ecom GmbH @ 2026-11-19 16:04 UTC (permalink / raw)
  To: gdb-patches


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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-19 16:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-19 16:04 [PATCH] gdb, m68hc11: fix for 68HC12 banked memory model Joel Linn | ecom GmbH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox