Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Michael Snyder <msnyder@redhat.com>
To: Andrew Cagney <ac131313@ges.redhat.com>
Cc: gdb-patches@sources.redhat.com, cagney@redhat.com
Subject: Re: [PATCH] mips-tdep.c: local defines, static functions
Date: Wed, 21 Aug 2002 15:28:00 -0000	[thread overview]
Message-ID: <3D641017.462B30B9@redhat.com> (raw)
In-Reply-To: <3D62ECF9.50207@ges.redhat.com>

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

Andrew Cagney wrote:
> 
> > + #define MSYMBOL_IS_SPECIAL(msym) \
> > +   (((long) MSYMBOL_INFO (msym) & 0x80000000) != 0)
> > + #define MSYMBOL_SIZE(msym) \
> > +   ((long) MSYMBOL_INFO (msym) & 0x7fffffff)
> > +
> 
> ``Macro's are bad m'kay.''
> 
> Could you please retain these functions:

Done and committed, as follows:

[-- Attachment #2: function.diff --]
[-- Type: text/plain, Size: 3560 bytes --]

2002-08-21  Michael Snyder  <msnyder@redhat.com>

	* mips-tdep.c (MSYMBOL_IS_SPECIAL): Replace macro with function.
	(MSYMBOL_SIZE): Replace macro with function.

Index: mips-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/mips-tdep.c,v
retrieving revision 1.116
diff -p -r1.116 mips-tdep.c
*** mips-tdep.c	21 Aug 2002 01:08:22 -0000	1.116
--- mips-tdep.c	21 Aug 2002 22:16:30 -0000
*************** mips_saved_regsize (void)
*** 173,179 ****
      return 4;
  }
  
! /* Macros for setting and testing a bit in a minimal symbol that
     marks it as 16-bit function.  The MSB of the minimal symbol's
     "info" field is used for this purpose. This field is already
     being used to store the symbol size, so the assumption is
--- 173,179 ----
      return 4;
  }
  
! /* Functions for setting and testing a bit in a minimal symbol that
     marks it as 16-bit function.  The MSB of the minimal symbol's
     "info" field is used for this purpose. This field is already
     being used to store the symbol size, so the assumption is
*************** mips_saved_regsize (void)
*** 187,197 ****
     MSYMBOL_SIZE         returns the size of the minimal symbol, i.e.
     the "info" field with the "special" bit masked out */
  
- #define MSYMBOL_IS_SPECIAL(msym) \
-   (((long) MSYMBOL_INFO (msym) & 0x80000000) != 0)
- #define MSYMBOL_SIZE(msym) \
-   ((long) MSYMBOL_INFO (msym) & 0x7fffffff)
- 
  static void
  mips_elf_make_msymbol_special (asymbol *sym, struct minimal_symbol *msym)
  {
--- 187,192 ----
*************** mips_elf_make_msymbol_special (asymbol *
*** 203,208 ****
--- 198,215 ----
      } 
  }
  
+ static int
+ msymbol_is_special (struct minimal_symbol *msym)
+ {
+   return (((long) MSYMBOL_INFO (msym) & 0x80000000) != 0);
+ }
+ 
+ static long
+ msymbol_size (struct minimal_symbol *msym)
+ {
+   return ((long) MSYMBOL_INFO (msym) & 0x7fffffff);
+ }
+ 
  /* XFER a value from the big/little/left end of the register.
     Depending on the size of the value it might occupy the entire
     register or just part of it.  Make an allowance for this, aligning
*************** pc_is_mips16 (bfd_vma memaddr)
*** 745,751 ****
       MIPS16 or normal MIPS.  */
    sym = lookup_minimal_symbol_by_pc (memaddr);
    if (sym)
!     return MSYMBOL_IS_SPECIAL (sym);
    else
      return 0;
  }
--- 752,758 ----
       MIPS16 or normal MIPS.  */
    sym = lookup_minimal_symbol_by_pc (memaddr);
    if (sym)
!     return msymbol_is_special (sym);
    else
      return 0;
  }
*************** mips_dump_tdep (struct gdbarch *current_
*** 6137,6145 ****
  		      "mips_dump_tdep: ECOFF_REG_TO_REGNUM # %s\n",
  		      XSTRING (ECOFF_REG_TO_REGNUM (REGNUM)));
    fprintf_unfiltered (file,
- 		      "mips_dump_tdep: ELF_MAKE_MSYMBOL_SPECIAL # %s\n",
- 		      XSTRING (ELF_MAKE_MSYMBOL_SPECIAL (SYM, MSYM)));
-   fprintf_unfiltered (file,
  		      "mips_dump_tdep: FCRCS_REGNUM = %d\n",
  		      FCRCS_REGNUM);
    fprintf_unfiltered (file,
--- 6144,6149 ----
*************** mips_dump_tdep (struct gdbarch *current_
*** 6235,6245 ****
    fprintf_unfiltered (file,
  		      "mips_dump_tdep: MIPS_SAVED_REGSIZE = %d\n",
  		      MIPS_SAVED_REGSIZE);
-   fprintf_unfiltered (file,
- 		      "mips_dump_tdep: MSYMBOL_IS_SPECIAL = function?\n");
-   fprintf_unfiltered (file,
- 		      "mips_dump_tdep: MSYMBOL_SIZE # %s\n",
- 		      XSTRING (MSYMBOL_SIZE (MSYM)));
    fprintf_unfiltered (file,
  		      "mips_dump_tdep: OP_LDFPR = used?\n");
    fprintf_unfiltered (file,
--- 6239,6244 ----

      reply	other threads:[~2002-08-21 22:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-20 17:55 Michael Snyder
2002-08-20 18:29 ` Andrew Cagney
2002-08-21 15:28   ` Michael Snyder [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=3D641017.462B30B9@redhat.com \
    --to=msnyder@redhat.com \
    --cc=ac131313@ges.redhat.com \
    --cc=cagney@redhat.com \
    --cc=gdb-patches@sources.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