Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Nathan Sidwell <nathan@codesourcery.com>
Cc: gdb-patches@sources.redhat.com,  msnyder@redhat.com
Subject: Re: [patch] Fix ms1 warnings
Date: Thu, 01 Dec 2005 13:43:00 -0000	[thread overview]
Message-ID: <438EFDF3.2050106@codesourcery.com> (raw)
In-Reply-To: <438EF905.9020502@codesourcery.com>

[-- Attachment #1: Type: text/plain, Size: 336 bytes --]

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


[-- Attachment #2: ms1-clean.diff --]
[-- Type: text/plain, Size: 5146 bytes --]

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 ----

      reply	other threads:[~2005-12-01 13:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-01 13:22 Nathan Sidwell
2005-12-01 13:43 ` Nathan Sidwell [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=438EFDF3.2050106@codesourcery.com \
    --to=nathan@codesourcery.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=msnyder@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox