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]

Re: [patch] Fix ms1 warnings


Nathan Sidwell wrote:
I've installed this obvious patch to silence some warnings and remove a compilation error.

tested on ms1-elf

oops, forgot to attach the patch,


--
Nathan Sidwell    ::   http://www.codesourcery.com   ::     CodeSourcery LLC
nathan@codesourcery.com    ::     http://www.planetfall.pwp.blueyonder.co.uk

2005-12-01  Nathan Sidwell  <nathan@codesourcery.com>

	* ms1-tdep.c (ms1_register_name): Const qualify array.
	(ms1_registers_info): Use gdb_byte.
	(ms1_push_dummy_call): Likewise.
	(ms1_gdbarch_init): Remove illformed nested prototype.

Index: ms1-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/ms1-tdep.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -c -3 -p -r1.1 -r1.2
*** ms1-tdep.c	15 Aug 2005 21:46:38 -0000	1.1
--- ms1-tdep.c	1 Dec 2005 13:19:58 -0000	1.2
*************** enum ms1_gdb_regnums
*** 126,132 ****
  static const char *
  ms1_register_name (int regnum)
  {
!   static char *register_names[] = {
      /* CPU regs.  */
      "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
      "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",
--- 126,132 ----
  static const char *
  ms1_register_name (int regnum)
  {
!   static const char *const register_names[] = {
      /* CPU regs.  */
      "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
      "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",
*************** ms1_registers_info (struct gdbarch *gdba
*** 530,536 ****
                 || regnum == MS1_COPRO_PSEUDOREG_REGNUM)
  	{
  	  /* Special output handling for the 'coprocessor' register.  */
! 	  char *buf;
  
  	  buf = alloca (register_size (gdbarch, MS1_COPRO_REGNUM));
  	  frame_register_read (frame, MS1_COPRO_REGNUM, buf);
--- 530,536 ----
                 || regnum == MS1_COPRO_PSEUDOREG_REGNUM)
  	{
  	  /* Special output handling for the 'coprocessor' register.  */
! 	  gdb_byte *buf;
  
  	  buf = alloca (register_size (gdbarch, MS1_COPRO_REGNUM));
  	  frame_register_read (frame, MS1_COPRO_REGNUM, buf);
*************** ms1_registers_info (struct gdbarch *gdba
*** 545,558 ****
        else if (regnum == MS1_MAC_REGNUM || regnum == MS1_MAC_PSEUDOREG_REGNUM)
  	{
  	  ULONGEST oldmac, ext_mac, newmac;
! 	  char buf[3 * sizeof (LONGEST)];
  
  	  /* Get the two "real" mac registers.  */
  	  frame_register_read (frame, MS1_MAC_REGNUM, buf);
  	  oldmac = extract_unsigned_integer (buf,
  					     register_size (gdbarch,
  							    MS1_MAC_REGNUM));
! 	  if (gdbarch_bfd_arch_info (gdbarch)->mach == bfd_mach_mrisc2)
  	    {
  	      frame_register_read (frame, MS1_EXMAC_REGNUM, buf);
  	      ext_mac = extract_unsigned_integer (buf,
--- 545,559 ----
        else if (regnum == MS1_MAC_REGNUM || regnum == MS1_MAC_PSEUDOREG_REGNUM)
  	{
  	  ULONGEST oldmac, ext_mac, newmac;
! 	  gdb_byte buf[3 * sizeof (LONGEST)];
  
  	  /* Get the two "real" mac registers.  */
  	  frame_register_read (frame, MS1_MAC_REGNUM, buf);
  	  oldmac = extract_unsigned_integer (buf,
  					     register_size (gdbarch,
  							    MS1_MAC_REGNUM));
! 	  if (gdbarch_bfd_arch_info (gdbarch)->mach == bfd_mach_mrisc2
! 	      || gdbarch_bfd_arch_info (gdbarch)->mach == bfd_mach_ms2)
  	    {
  	      frame_register_read (frame, MS1_EXMAC_REGNUM, buf);
  	      ext_mac = extract_unsigned_integer (buf,
*************** ms1_push_dummy_call (struct gdbarch *gdb
*** 594,600 ****
  		     int struct_return, CORE_ADDR struct_addr)
  {
  #define wordsize 4
!   char buf[MS1_MAX_STRUCT_SIZE];
    int argreg = MS1_1ST_ARGREG;
    int split_param_len = 0;
    int stack_dest = sp;
--- 595,601 ----
  		     int struct_return, CORE_ADDR struct_addr)
  {
  #define wordsize 4
!   gdb_byte buf[MS1_MAX_STRUCT_SIZE];
    int argreg = MS1_1ST_ARGREG;
    int split_param_len = 0;
    int stack_dest = sp;
*************** ms1_push_dummy_call (struct gdbarch *gdb
*** 606,612 ****
       MS1_LAST_ARGREG.  */
    for (i = 0; i < nargs && argreg <= MS1_LAST_ARGREG; i++)
      {
!       const char *val;
        typelen = TYPE_LENGTH (value_type (args[i]));
        switch (typelen)
  	{
--- 607,613 ----
       MS1_LAST_ARGREG.  */
    for (i = 0; i < nargs && argreg <= MS1_LAST_ARGREG; i++)
      {
!       const gdb_byte *val;
        typelen = TYPE_LENGTH (value_type (args[i]));
        switch (typelen)
  	{
*************** ms1_push_dummy_call (struct gdbarch *gdb
*** 658,664 ****
    /* Next, the rest of the arguments go onto the stack, in reverse order.  */
    for (j = nargs - 1; j >= i; j--)
      {
!       char *val;
        /* Right-justify the value in an aligned-length buffer.  */
        typelen = TYPE_LENGTH (value_type (args[j]));
        slacklen = (wordsize - (typelen % wordsize)) % wordsize;
--- 659,666 ----
    /* Next, the rest of the arguments go onto the stack, in reverse order.  */
    for (j = nargs - 1; j >= i; j--)
      {
!       gdb_byte *val;
!       
        /* Right-justify the value in an aligned-length buffer.  */
        typelen = TYPE_LENGTH (value_type (args[j]));
        slacklen = (wordsize - (typelen % wordsize)) % wordsize;
*************** static struct gdbarch *
*** 961,967 ****
  ms1_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
  {
    struct gdbarch *gdbarch;
-   static void ms1_frame_unwind_init (struct gdbarch *);
  
    /* Find a candidate among the list of pre-declared architectures.  */
    arches = gdbarch_list_lookup_by_info (arches, &info);
--- 963,968 ----

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