Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [COMMIT] Update s390-tdep.c to gdb_byte changes
@ 2005-05-16 12:40 Ulrich Weigand
  2005-05-16 13:40 ` Mark Kettenis
  0 siblings, 1 reply; 3+ messages in thread
From: Ulrich Weigand @ 2005-05-16 12:40 UTC (permalink / raw)
  To: gdb-patches

Hello,

this updates s390-tdep.c to remove the gdb_byte-related warnings.
Tested on s390-ibm-linux and s390x-ibm-linux, applied to mainline.

Bye,
Ulrich

ChangeLog:

	* s390-tdep.c (s390_pseudo_register_read, s390_pseudo_register_write):
	Change type of 'buf' argument to gdb_byte *.
	(s390x_pseudo_register_read, s390x_pseudo_register_write): Likewise.
	(s390_register_to_value): Change type of 'out' to gdb_byte *, change
	type of 'in' to gdb_byte [].
	(s390_value_to_register): Change type of 'in' to gdb_byte *, change
	type of 'out' to gdb_byte [].
	(s390_return_value): Change type of 'out' and 'in' to gdb_byte *.


Index: gdb/s390-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/s390-tdep.c,v
retrieving revision 1.143
diff -c -p -r1.143 s390-tdep.c
*** gdb/s390-tdep.c	31 Mar 2005 19:58:26 -0000	1.143
--- gdb/s390-tdep.c	16 May 2005 10:38:48 -0000
*************** s390_dwarf_reg_to_regnum (int reg)
*** 210,216 ****
  
  static void
  s390_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
! 			   int regnum, void *buf)
  {
    ULONGEST val;
  
--- 210,216 ----
  
  static void
  s390_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
! 			   int regnum, gdb_byte *buf)
  {
    ULONGEST val;
  
*************** s390_pseudo_register_read (struct gdbarc
*** 233,239 ****
  
  static void
  s390_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
! 			    int regnum, const void *buf)
  {
    ULONGEST val, psw;
  
--- 233,239 ----
  
  static void
  s390_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
! 			    int regnum, const gdb_byte *buf)
  {
    ULONGEST val, psw;
  
*************** s390_pseudo_register_write (struct gdbar
*** 260,266 ****
  
  static void
  s390x_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
! 			    int regnum, void *buf)
  {
    ULONGEST val;
  
--- 260,266 ----
  
  static void
  s390x_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
! 			    int regnum, gdb_byte *buf)
  {
    ULONGEST val;
  
*************** s390x_pseudo_register_read (struct gdbar
*** 282,288 ****
  
  static void
  s390x_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
! 			     int regnum, const void *buf)
  {
    ULONGEST val, psw;
  
--- 282,288 ----
  
  static void
  s390x_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
! 			     int regnum, const gdb_byte *buf)
  {
    ULONGEST val, psw;
  
*************** s390_convert_register_p (int regno, stru
*** 316,324 ****
  
  static void
  s390_register_to_value (struct frame_info *frame, int regnum,
!                         struct type *valtype, void *out)
  {
!   char in[8];
    int len = TYPE_LENGTH (valtype);
    gdb_assert (len < 8);
  
--- 316,324 ----
  
  static void
  s390_register_to_value (struct frame_info *frame, int regnum,
!                         struct type *valtype, gdb_byte *out)
  {
!   gdb_byte in[8];
    int len = TYPE_LENGTH (valtype);
    gdb_assert (len < 8);
  
*************** s390_register_to_value (struct frame_inf
*** 328,336 ****
  
  static void
  s390_value_to_register (struct frame_info *frame, int regnum,
!                         struct type *valtype, const void *in)
  {
!   char out[8];
    int len = TYPE_LENGTH (valtype);
    gdb_assert (len < 8);
  
--- 328,336 ----
  
  static void
  s390_value_to_register (struct frame_info *frame, int regnum,
!                         struct type *valtype, const gdb_byte *in)
  {
!   gdb_byte out[8];
    int len = TYPE_LENGTH (valtype);
    gdb_assert (len < 8);
  
*************** s390_return_value_convention (struct gdb
*** 2694,2700 ****
  
  static enum return_value_convention
  s390_return_value (struct gdbarch *gdbarch, struct type *type, 
! 		   struct regcache *regcache, void *out, const void *in)
  {
    int word_size = gdbarch_ptr_bit (gdbarch) / 8;
    int length = TYPE_LENGTH (type);
--- 2694,2701 ----
  
  static enum return_value_convention
  s390_return_value (struct gdbarch *gdbarch, struct type *type, 
! 		   struct regcache *regcache, gdb_byte *out,
! 		   const gdb_byte *in)
  {
    int word_size = gdbarch_ptr_bit (gdbarch) / 8;
    int length = TYPE_LENGTH (type);
-- 
  Dr. Ulrich Weigand
  Linux on zSeries Development
  Ulrich.Weigand@de.ibm.com


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [COMMIT] Update s390-tdep.c to gdb_byte changes
  2005-05-16 12:40 [COMMIT] Update s390-tdep.c to gdb_byte changes Ulrich Weigand
@ 2005-05-16 13:40 ` Mark Kettenis
  2005-05-16 16:37   ` Ulrich Weigand
  0 siblings, 1 reply; 3+ messages in thread
From: Mark Kettenis @ 2005-05-16 13:40 UTC (permalink / raw)
  To: uweigand; +Cc: gdb-patches

   From: Ulrich Weigand <uweigand@de.ibm.com>
   Date: Mon, 16 May 2005 12:56:06 +0200 (CEST)

   Hello,

   this updates s390-tdep.c to remove the gdb_byte-related warnings.
   Tested on s390-ibm-linux and s390x-ibm-linux, applied to mainline.

Great.  There are some casts in s390_return_value() that can go now,
and s390_breakpoint_from_pc() should also be converted to use gdb_byte
instead of unsigned char.  Would be great if you could do that too.

Mark


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [COMMIT] Update s390-tdep.c to gdb_byte changes
  2005-05-16 13:40 ` Mark Kettenis
@ 2005-05-16 16:37   ` Ulrich Weigand
  0 siblings, 0 replies; 3+ messages in thread
From: Ulrich Weigand @ 2005-05-16 16:37 UTC (permalink / raw)
  To: Mark Kettenis; +Cc: uweigand, gdb-patches

Mark Kettenis wrote:

> Great.  There are some casts in s390_return_value() that can go now,
> and s390_breakpoint_from_pc() should also be converted to use gdb_byte
> instead of unsigned char.  Would be great if you could do that too.

Sorry for missing those.  I've now applied the following patch, too.

Bye,
Ulrich


ChangeLog:

	* s390-tdep.c (s390_return_value): Remove unnecessary casts.
	(s390_breakpoint_from_pc): Change type of return value and
	'breakpoint' to const gdb_byte *.

Index: gdb/s390-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/s390-tdep.c,v
retrieving revision 1.144
diff -c -p -r1.144 s390-tdep.c
*** gdb/s390-tdep.c	16 May 2005 10:55:03 -0000	1.144
--- gdb/s390-tdep.c	16 May 2005 12:20:37 -0000
*************** s390_return_value (struct gdbarch *gdbar
*** 2726,2733 ****
  	  else if (length == 2*word_size)
  	    {
  	      regcache_cooked_write (regcache, S390_R2_REGNUM, in);
! 	      regcache_cooked_write (regcache, S390_R3_REGNUM,
! 				     (const char *)in + word_size);
  	    }
  	  else
  	    internal_error (__FILE__, __LINE__, _("invalid return type"));
--- 2726,2732 ----
  	  else if (length == 2*word_size)
  	    {
  	      regcache_cooked_write (regcache, S390_R2_REGNUM, in);
! 	      regcache_cooked_write (regcache, S390_R3_REGNUM, in + word_size);
  	    }
  	  else
  	    internal_error (__FILE__, __LINE__, _("invalid return type"));
*************** s390_return_value (struct gdbarch *gdbar
*** 2759,2766 ****
  	  else if (length == 2*word_size)
  	    {
  	      regcache_cooked_read (regcache, S390_R2_REGNUM, out);
! 	      regcache_cooked_read (regcache, S390_R3_REGNUM,
! 				    (char *)out + word_size);
  	    }
  	  else
  	    internal_error (__FILE__, __LINE__, _("invalid return type"));
--- 2758,2764 ----
  	  else if (length == 2*word_size)
  	    {
  	      regcache_cooked_read (regcache, S390_R2_REGNUM, out);
! 	      regcache_cooked_read (regcache, S390_R3_REGNUM, out + word_size);
  	    }
  	  else
  	    internal_error (__FILE__, __LINE__, _("invalid return type"));
*************** s390_return_value (struct gdbarch *gdbar
*** 2778,2787 ****
  
  /* Breakpoints.  */
  
! static const unsigned char *
  s390_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
  {
!   static unsigned char breakpoint[] = { 0x0, 0x1 };
  
    *lenptr = sizeof (breakpoint);
    return breakpoint;
--- 2776,2785 ----
  
  /* Breakpoints.  */
  
! static const gdb_byte *
  s390_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
  {
!   static const gdb_byte breakpoint[] = { 0x0, 0x1 };
  
    *lenptr = sizeof (breakpoint);
    return breakpoint;


-- 
  Dr. Ulrich Weigand
  Linux on zSeries Development
  Ulrich.Weigand@de.ibm.com


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-05-16 12:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-16 12:40 [COMMIT] Update s390-tdep.c to gdb_byte changes Ulrich Weigand
2005-05-16 13:40 ` Mark Kettenis
2005-05-16 16:37   ` Ulrich Weigand

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