[binutils-gdb] gdb/m68hc11: fix use_page_register check in m68hc11-tdep.c

Andrew Burgess aburgess@sourceware.org
Tue Dec 1 15:39:13 GMT 2026


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=cf73559dd5900cc2e1620322e7e022d3a0d7f430

commit cf73559dd5900cc2e1620322e7e022d3a0d7f430
Author: Joel Linn <j.linn@ecom.de>
Date:   Tue Dec 1 15:34:43 2026 +0000

    gdb/m68hc11: fix use_page_register check in m68hc11-tdep.c
    
    Commit:
    
      commit 345bd07cce33565f1cd66acabdaf387ca3a7ccb3
      Date:   Mon Nov 15 11:29:39 2021 -0500
    
        gdb: fix gdbarch_tdep ODR violation
    
    Changed this:
    
      #define USE_PAGE_REGISTER(gdbarch) (gdbarch_tdep (gdbarch)->use_page_register)
    
    To this:
    
      static int
      use_page_register (gdbarch *arch)
      {
        m68gc11_gdbarch_tdep *tdep = (m68gc11_gdbarch_tdep *) gdbarch_tdep (arch);
        return tdep->stack_correction;
      }
    
    Notice that the new code checks the stack_correction field, not the
    use_page_register field.  This is a copy & paste error.  This was
    spotted and posted to the mailing list combined with a separate fix
    here:
    
      https://inbox.sourceware.org/gdb-patches/5fbef3b4-7117-439b-a870-aed245091455@ecom.de

Diff:
---
 gdb/m68hc11-tdep.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/m68hc11-tdep.c b/gdb/m68hc11-tdep.c
index 6c36aee83c1..982bfd62b5f 100644
--- a/gdb/m68hc11-tdep.c
+++ b/gdb/m68hc11-tdep.c
@@ -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


More information about the Gdb-cvs mailing list