This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[PATCH]: Support 68HC12 arch in Gdb


Hi!

I've committed the following patch to support 68HC12 in Gdb (within 68HC11-tdep
since it's very very close to it). This is the initial 68HC12 support to:

 - get the bfd_arch_m68hc12 recognized by Gdb-multi-arch
 - disassemble correctly between 68hc11/68hc12.


	Stephane


2000-11-24  Stephane Carrez  <Stephane.Carrez@worldnet.fr>

	* m68hc11-tdep.c  (gdb_print_insn_m68hc11): New function.
	(_initialize_m68hc11_tdep): Install it. Register bfd_arch_m68hc12.
Index: m68hc11-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/m68hc11-tdep.c,v
retrieving revision 1.7
diff -p -r1.7 m68hc11-tdep.c
*** m68hc11-tdep.c	2000/11/24 20:59:42	1.7
--- m68hc11-tdep.c	2000/11/24 21:21:30
*************** m68hc11_register_raw_size (int reg_nr)
*** 965,970 ****
--- 965,979 ----
    return M68HC11_REG_SIZE;
  }
  
+ static int
+ gdb_print_insn_m68hc11 (bfd_vma memaddr, disassemble_info *info)
+ {
+   if (TARGET_ARCHITECTURE->arch == bfd_arch_m68hc11)
+     return print_insn_m68hc11 (memaddr, info);
+   else
+     return print_insn_m68hc12 (memaddr, info);
+ }
+ 
  static struct gdbarch *
  m68hc11_gdbarch_init (struct gdbarch_info info,
                        struct gdbarch_list *arches)
*************** void
*** 1112,1119 ****
  _initialize_m68hc11_tdep (void)
  {
    register_gdbarch_init (bfd_arch_m68hc11, m68hc11_gdbarch_init);
    if (!tm_print_insn)		/* Someone may have already set it */
!     tm_print_insn = print_insn_m68hc11;
  
    add_com ("regs", class_vars, show_regs, "Print all registers");
  } 
--- 1121,1129 ----
  _initialize_m68hc11_tdep (void)
  {
    register_gdbarch_init (bfd_arch_m68hc11, m68hc11_gdbarch_init);
+   register_gdbarch_init (bfd_arch_m68hc12, m68hc11_gdbarch_init);
    if (!tm_print_insn)		/* Someone may have already set it */
!     tm_print_insn = gdb_print_insn_m68hc11;
  
    add_com ("regs", class_vars, show_regs, "Print all registers");
  } 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]