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]

[commit] gdb_byte related changes for M32R targets


I've just committed the attached patch on the mainline.
It replaces char and void with gdb_byte in m32r related files.

With it, both m32r-elf and m32r-linux targets build with -Werror.

Kei Sakamoto

===

2005-11-08  Kei Sakamoto  <sakamoto.kei@renesas.com>

        * m32r-linux-tdep.c (linux_sigtramp_code): Use 'gdb_byte' instead
        of 'unsigned char'.
        (m32r_linux_sigtramp_start): Likewise.
        (linux_rt_sigtramp_code): Likewise.
        (m32r_linux_rt_sigtramp_start): Likewise.
        (m32r_linux_sigtramp_frame_prev_register): Use 'gdb_byte *' instead
        of 'void *'.
        * m32r-tdep.c (m32r_memory_insert_breakpoint): Use 'gdb_byte'
        instead of 'char'.
        (m32r_memory_remove_breakpoint): Likewise.
        (m32r_breakpoint_from_pc): Likewise.
        (m32r_store_return_value): Likewise.
        (decode_prologue): Likewise.
        (m32r_push_dummy_call): Likewise.
        (m32r_return_value): Use 'gdb_byte *' instead of 'void *'.
        * remote-m32r-sdi.c (m32r_xfer_memory): Use 'gdb_byte' instead of
        'char'.
Index: m32r-linux-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/m32r-linux-tdep.c,v
retrieving revision 1.3
diff -p -r1.3 m32r-linux-tdep.c
*** m32r-linux-tdep.c	31 Mar 2005 19:58:25 -0000	1.3
--- m32r-linux-tdep.c	8 Nov 2005 05:31:38 -0000
***************
*** 77,83 ****
     to the ones used by the kernel.  Therefore, these trampolines are
     supported too.  */
  
! static const unsigned char linux_sigtramp_code[] = {
    0x67, 0x77, 0x10, 0xf2,
  };
  
--- 77,83 ----
     to the ones used by the kernel.  Therefore, these trampolines are
     supported too.  */
  
! static const gdb_byte linux_sigtramp_code[] = {
    0x67, 0x77, 0x10, 0xf2,
  };
  
*************** static const unsigned char linux_sigtram
*** 87,93 ****
  static CORE_ADDR
  m32r_linux_sigtramp_start (CORE_ADDR pc, struct frame_info *next_frame)
  {
!   unsigned char buf[4];
  
    /* We only recognize a signal trampoline if PC is at the start of
       one of the instructions.  We optimize for finding the PC at the
--- 87,93 ----
  static CORE_ADDR
  m32r_linux_sigtramp_start (CORE_ADDR pc, struct frame_info *next_frame)
  {
!   gdb_byte buf[4];
  
    /* We only recognize a signal trampoline if PC is at the start of
       one of the instructions.  We optimize for finding the PC at the
*************** m32r_linux_sigtramp_start (CORE_ADDR pc,
*** 125,131 ****
  
     The effect is to call the system call rt_sigreturn.  */
  
! static const unsigned char linux_rt_sigtramp_code[] = {
    0x97, 0xf0, 0x00, 0xad, 0x10, 0xf2, 0xf0, 0x00,
  };
  
--- 125,131 ----
  
     The effect is to call the system call rt_sigreturn.  */
  
! static const gdb_byte linux_rt_sigtramp_code[] = {
    0x97, 0xf0, 0x00, 0xad, 0x10, 0xf2, 0xf0, 0x00,
  };
  
*************** static const unsigned char linux_rt_sigt
*** 135,141 ****
  static CORE_ADDR
  m32r_linux_rt_sigtramp_start (CORE_ADDR pc, struct frame_info *next_frame)
  {
!   unsigned char buf[4];
  
    /* We only recognize a signal trampoline if PC is at the start of
       one of the instructions.  We optimize for finding the PC at the
--- 135,141 ----
  static CORE_ADDR
  m32r_linux_rt_sigtramp_start (CORE_ADDR pc, struct frame_info *next_frame)
  {
!   gdb_byte buf[4];
  
    /* We only recognize a signal trampoline if PC is at the start of
       one of the instructions.  We optimize for finding the PC at the
*************** m32r_linux_sigtramp_frame_prev_register 
*** 282,288 ****
  					 int regnum, int *optimizedp,
  					 enum lval_type *lvalp,
  					 CORE_ADDR *addrp,
! 					 int *realnump, void *valuep)
  {
    struct m32r_frame_cache *cache =
      m32r_linux_sigtramp_frame_cache (next_frame, this_cache);
--- 282,288 ----
  					 int regnum, int *optimizedp,
  					 enum lval_type *lvalp,
  					 CORE_ADDR *addrp,
! 					 int *realnump, gdb_byte *valuep)
  {
    struct m32r_frame_cache *cache =
      m32r_linux_sigtramp_frame_cache (next_frame, this_cache);
Index: m32r-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/m32r-tdep.c,v
retrieving revision 1.38
diff -p -r1.38 m32r-tdep.c
*** m32r-tdep.c	1 May 2005 19:58:54 -0000	1.38
--- m32r-tdep.c	8 Nov 2005 05:31:38 -0000
*************** static int
*** 84,91 ****
  m32r_memory_insert_breakpoint (CORE_ADDR addr, bfd_byte *contents_cache)
  {
    int val;
!   char buf[4];
!   char bp_entry[] = { 0x10, 0xf1 };	/* dpt */
  
    /* Save the memory contents.  */
    val = target_read_memory (addr & 0xfffffffc, contents_cache, 4);
--- 84,91 ----
  m32r_memory_insert_breakpoint (CORE_ADDR addr, bfd_byte *contents_cache)
  {
    int val;
!   gdb_byte buf[4];
!   gdb_byte bp_entry[] = { 0x10, 0xf1 };	/* dpt */
  
    /* Save the memory contents.  */
    val = target_read_memory (addr & 0xfffffffc, contents_cache, 4);
*************** static int
*** 137,143 ****
  m32r_memory_remove_breakpoint (CORE_ADDR addr, bfd_byte *contents_cache)
  {
    int val;
!   char buf[4];
  
    buf[0] = contents_cache[0];
    buf[1] = contents_cache[1];
--- 137,143 ----
  m32r_memory_remove_breakpoint (CORE_ADDR addr, bfd_byte *contents_cache)
  {
    int val;
!   gdb_byte buf[4];
  
    buf[0] = contents_cache[0];
    buf[1] = contents_cache[1];
*************** m32r_memory_remove_breakpoint (CORE_ADDR
*** 161,172 ****
    return val;
  }
  
! static const unsigned char *
  m32r_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
  {
!   static char be_bp_entry[] = { 0x10, 0xf1, 0x70, 0x00 };	/* dpt -> nop */
!   static char le_bp_entry[] = { 0x00, 0x70, 0xf1, 0x10 };	/* dpt -> nop */
!   unsigned char *bp;
  
    /* Determine appropriate breakpoint.  */
    if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
--- 161,172 ----
    return val;
  }
  
! static const gdb_byte *
  m32r_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
  {
!   static gdb_byte be_bp_entry[] = { 0x10, 0xf1, 0x70, 0x00 };	/* dpt -> nop */
!   static gdb_byte le_bp_entry[] = { 0x00, 0x70, 0xf1, 0x10 };	/* dpt -> nop */
!   gdb_byte *bp;
  
    /* Determine appropriate breakpoint.  */
    if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
*************** m32r_store_return_value (struct type *ty
*** 250,256 ****
  
    if (len > 4)
      {
!       regval = extract_unsigned_integer ((char *) valbuf + 4, len - 4);
        regcache_cooked_write_unsigned (regcache, RET1_REGNUM + 1, regval);
      }
  }
--- 250,256 ----
  
    if (len > 4)
      {
!       regval = extract_unsigned_integer ((gdb_byte *) valbuf + 4, len - 4);
        regcache_cooked_write_unsigned (regcache, RET1_REGNUM + 1, regval);
      }
  }
*************** decode_prologue (CORE_ADDR start_pc, COR
*** 345,351 ****
        if ((insn >> 8) == 0x4f)	/* addi sp, xx */
  	/* add 8 bit sign-extended offset */
  	{
! 	  int stack_adjust = (char) (insn & 0xff);
  
  	  /* there are probably two of these stack adjustments:
  	     1) A negative one in the prologue, and
--- 345,351 ----
        if ((insn >> 8) == 0x4f)	/* addi sp, xx */
  	/* add 8 bit sign-extended offset */
  	{
! 	  int stack_adjust = (gdb_byte) (insn & 0xff);
  
  	  /* there are probably two of these stack adjustments:
  	     1) A negative one in the prologue, and
*************** m32r_frame_unwind_cache (struct frame_in
*** 574,580 ****
        else if ((op & 0xff00) == 0x4f00)
  	{
  	  /* addi sp, xx */
! 	  int n = (char) (op & 0xff);
  	  info->sp_offset += n;
  	}
        else if (op == 0x1d8f)
--- 574,580 ----
        else if ((op & 0xff00) == 0x4f00)
  	{
  	  /* addi sp, xx */
! 	  int n = (gdb_byte) (op & 0xff);
  	  info->sp_offset += n;
  	}
        else if (op == 0x1d8f)
*************** m32r_push_dummy_call (struct gdbarch *gd
*** 679,686 ****
    struct type *type;
    enum type_code typecode;
    CORE_ADDR regval;
!   char *val;
!   char valbuf[MAX_REGISTER_SIZE];
    int len;
    int odd_sized_struct;
  
--- 679,686 ----
    struct type *type;
    enum type_code typecode;
    CORE_ADDR regval;
!   gdb_byte *val;
!   gdb_byte valbuf[MAX_REGISTER_SIZE];
    int len;
    int odd_sized_struct;
  
*************** m32r_push_dummy_call (struct gdbarch *gd
*** 726,736 ****
  	{
  	  /* value gets right-justified in the register or stack word */
  	  memcpy (valbuf + (register_size (gdbarch, argreg) - len),
! 		  (char *) value_contents (args[argnum]), len);
  	  val = valbuf;
  	}
        else
! 	val = (char *) value_contents (args[argnum]);
  
        while (len > 0)
  	{
--- 726,736 ----
  	{
  	  /* value gets right-justified in the register or stack word */
  	  memcpy (valbuf + (register_size (gdbarch, argreg) - len),
! 		  (gdb_byte *) value_contents (args[argnum]), len);
  	  val = valbuf;
  	}
        else
! 	val = (gdb_byte *) value_contents (args[argnum]);
  
        while (len > 0)
  	{
*************** m32r_extract_return_value (struct type *
*** 791,798 ****
  
  enum return_value_convention
  m32r_return_value (struct gdbarch *gdbarch, struct type *valtype,
! 		   struct regcache *regcache, void *readbuf,
! 		   const void *writebuf)
  {
    if (TYPE_LENGTH (valtype) > 8)
      return RETURN_VALUE_STRUCT_CONVENTION;
--- 791,798 ----
  
  enum return_value_convention
  m32r_return_value (struct gdbarch *gdbarch, struct type *valtype,
! 		   struct regcache *regcache, gdb_byte *readbuf,
! 		   const gdb_byte *writebuf)
  {
    if (TYPE_LENGTH (valtype) > 8)
      return RETURN_VALUE_STRUCT_CONVENTION;
*************** m32r_frame_prev_register (struct frame_i
*** 852,858 ****
  			  void **this_prologue_cache,
  			  int regnum, int *optimizedp,
  			  enum lval_type *lvalp, CORE_ADDR *addrp,
! 			  int *realnump, void *bufferp)
  {
    struct m32r_unwind_cache *info
      = m32r_frame_unwind_cache (next_frame, this_prologue_cache);
--- 852,858 ----
  			  void **this_prologue_cache,
  			  int regnum, int *optimizedp,
  			  enum lval_type *lvalp, CORE_ADDR *addrp,
! 			  int *realnump, gdb_byte *bufferp)
  {
    struct m32r_unwind_cache *info
      = m32r_frame_unwind_cache (next_frame, this_prologue_cache);
Index: remote-m32r-sdi.c
===================================================================
RCS file: /cvs/src/src/gdb/remote-m32r-sdi.c,v
retrieving revision 1.13
diff -p -r1.13 remote-m32r-sdi.c
*** remote-m32r-sdi.c	2 Aug 2005 03:02:05 -0000	1.13
--- remote-m32r-sdi.c	8 Nov 2005 05:31:38 -0000
*************** m32r_files_info (struct target_ops *targ
*** 1032,1038 ****
  
  /* Read/Write memory.  */
  static int
! m32r_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len,
  		  int write,
  		  struct mem_attrib *attrib, struct target_ops *target)
  {
--- 1032,1038 ----
  
  /* Read/Write memory.  */
  static int
! m32r_xfer_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len,
  		  int write,
  		  struct mem_attrib *attrib, struct target_ops *target)
  {

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