This is the mail archive of the gdb-patches@sourceware.org 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]
Other format: [Raw text]

[HC11][PATCH]: Fixes for HC11/HC12 target


Hi!

Committed this patch for 68hc11/hc12 target on mainline and 6_4 branch:

 - it fixes the compilation warnings that occurred with gcc 3.4
 - it fixes the "call/print" commands (there is no longer need for
   a frame align handler)
 - it fixes a crash when debugging a prog not compiled with -g

Stephane

2005-11-11  Stephane Carrez  <stcarrez@nerim.fr>

	* m68hc11-tdep.c (m68hc11_pseudo_register_write): Use gdb_byte
	for buffers.
	(m68hc11_pseudo_register_read): Likewise.
	(m68hc11_return_value): Likewise.
	(m68hc11_frame_prev_register): Likewise.
	(m68hc11_frame_align): Remove as its seems no longer necessary.
	(m68hc11_gdbarch_init): Don't install frame_align handler.
	(m68hc11_scan_prologue): Fix crash that occurred when called from
	m68hc11_skip_prologue
Index: m68hc11-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/m68hc11-tdep.c,v
retrieving revision 1.108
diff -u -p -r1.108 m68hc11-tdep.c
--- m68hc11-tdep.c	11 Feb 2005 04:05:56 -0000	1.108
+++ m68hc11-tdep.c	11 Nov 2005 10:17:51 -0000
@@ -291,7 +291,7 @@ m68hc11_which_soft_register (CORE_ADDR a
 static void
 m68hc11_pseudo_register_read (struct gdbarch *gdbarch,
 			      struct regcache *regcache,
-			      int regno, void *buf)
+			      int regno, gdb_byte *buf)
 {
   /* The PC is a pseudo reg only for 68HC12 with the memory bank
      addressing mode.  */
@@ -332,7 +332,7 @@ m68hc11_pseudo_register_read (struct gdb
 static void
 m68hc11_pseudo_register_write (struct gdbarch *gdbarch,
 			       struct regcache *regcache,
-			       int regno, const void *buf)
+			       int regno, const gdb_byte *buf)
 {
   /* The PC is a pseudo reg only for 68HC12 with the memory bank
      addressing mode.  */
@@ -706,7 +706,8 @@ m68hc11_scan_prologue (CORE_ADDR pc, COR
                 break;
 
               save_addr -= 2;
-              info->saved_regs[saved_reg].addr = save_addr;
+              if (info->saved_regs)
+                info->saved_regs[saved_reg].addr = save_addr;
             }
           else
             {
@@ -905,7 +906,7 @@ m68hc11_frame_prev_register (struct fram
                              void **this_prologue_cache,
                              int regnum, int *optimizedp,
                              enum lval_type *lvalp, CORE_ADDR *addrp,
-                             int *realnump, void *bufferp)
+                             int *realnump, gdb_byte *bufferp)
 {
   struct m68hc11_unwind_cache *info
     = m68hc11_frame_unwind_cache (next_frame, this_prologue_cache);
@@ -1156,12 +1157,6 @@ m68hc11_print_registers_info (struct gdb
 }
 
 static CORE_ADDR
-m68hc11_stack_align (CORE_ADDR addr)
-{
-  return ((addr + 1) & -2);
-}
-
-static CORE_ADDR
 m68hc11_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
                          struct regcache *regcache, CORE_ADDR bp_addr,
                          int nargs, struct value **args, CORE_ADDR sp,
@@ -1177,11 +1172,7 @@ m68hc11_push_dummy_call (struct gdbarch 
   first_stack_argnum = 0;
   if (struct_return)
     {
-      /* The struct is allocated on the stack and gdb used the stack
-         pointer for the address of that struct.  We must apply the
-         stack offset on the address.  */
-      regcache_cooked_write_unsigned (regcache, HARD_D_REGNUM,
-                                      struct_addr + STACK_CORRECTION);
+      regcache_cooked_write_unsigned (regcache, HARD_D_REGNUM, struct_addr);
     }
   else if (nargs > 0)
     {
@@ -1324,8 +1315,8 @@ m68hc11_extract_return_value (struct typ
 
 enum return_value_convention
 m68hc11_return_value (struct gdbarch *gdbarch, struct type *valtype,
-		      struct regcache *regcache, void *readbuf,
-		      const void *writebuf)
+		      struct regcache *regcache, gdb_byte *readbuf,
+		      const gdb_byte *writebuf)
 {
   if (TYPE_CODE (valtype) == TYPE_CODE_STRUCT
       || TYPE_CODE (valtype) == TYPE_CODE_UNION
@@ -1526,7 +1517,6 @@ m68hc11_gdbarch_init (struct gdbarch_inf
   set_gdbarch_skip_prologue (gdbarch, m68hc11_skip_prologue);
   set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
   set_gdbarch_breakpoint_from_pc (gdbarch, m68hc11_breakpoint_from_pc);
-  set_gdbarch_deprecated_stack_align (gdbarch, m68hc11_stack_align);
   set_gdbarch_print_insn (gdbarch, gdb_print_insn_m68hc11);
 
   m68hc11_add_reggroups (gdbarch);

Attachment: signature.asc
Description: OpenPGP digital signature


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