]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
merge from mainline
authorElena Zannoni <ezannoni@kwikemart.cygnus.com>
Sun, 3 Nov 2002 21:54:26 +0000 (21:54 +0000)
committerElena Zannoni <ezannoni@kwikemart.cygnus.com>
Sun, 3 Nov 2002 21:54:26 +0000 (21:54 +0000)
19 files changed:
include/ChangeLog
include/ansidecl.h
include/elf/ChangeLog
include/elf/sh.h
include/getopt.h
include/opcode/ChangeLog
include/opcode/cgen.h
include/partition.h
libiberty/ChangeLog
libiberty/config.table
libiberty/cplus-dem.c
opcodes/ChangeLog
opcodes/m68hc11-dis.c
opcodes/sparc-opc.c
sim/common/ChangeLog
sim/common/cgen-trace.h
sim/sh/ChangeLog
sim/sh/gencode.c
sim/sh/interp.c

index 257e381931feb1b1cd12f94ac121c9fbaea325c4..8efd9a3cd0bbbf916fc08d67293972004bc32bb5 100644 (file)
@@ -1,3 +1,23 @@
+2002-10-26  Roger Sayle  <roger@eyesopen.com>
+
+       * partition.h:  Close the extern "C" scope when compiling with C++.
+
+2002-10-26  Roger Sayle  <roger@eyesopen.com>
+           DJ Delorie <dj@redhat.com>
+
+       PR bootstrap/8351
+       * getopt.h: Avoid prototyping getopt with no arguments in C++.
+
+2002-10-24  Nathan Tallent  <eraxxon@alumni.rice.edu>
+
+       * ansidecl.h (__STDC__): Add (__alpha && __cplusplus) to the
+       list of platform compilers that may look, smell and act
+       like __STDC__ but that may not define it.
+
+2002-10-11  David O'Brien  <obrien@FreeBSD.org>
+
+       * getopt.h: getopt is in unistd.h (based on SUSv2).
+
 2002-09-26  Jakub Jelinek  <jakub@redhat.com>
 
        * elf/x86-64.h: Add TLS relocs.
index 9a7c5777ff2ece9641045ce4a6b6b90e93b3b3c7..d169b4f50ed6c8d7b0e17e2b94888c67461e9750 100644 (file)
@@ -136,10 +136,13 @@ So instead we use the macro below and test it against specific values.  */
 #define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__)
 #endif /* GCC_VERSION */
 
-#if defined (__STDC__) || defined (_AIX) || (defined (__mips) && defined (_SYSTYPE_SVR4)) || defined(_WIN32)
+#if defined (__STDC__) || defined (_AIX) || (defined (__mips) && defined (_SYSTYPE_SVR4)) || defined(_WIN32) || (defined(__alpha) && defined(__cplusplus))
 /* All known AIX compilers implement these things (but don't always
    define __STDC__).  The RISC/OS MIPS compiler defines these things
    in SVR4 mode, but does not define __STDC__.  */
+/* eraxxon@alumni.rice.edu: The Compaq C++ compiler, unlike many other
+   C++ compilers, does not define __STDC__, though it acts as if this
+   was so. (Verified versions: 5.7, 6.2, 6.3, 6.5) */
 
 #define ANSI_PROTOTYPES        1
 #define PTR            void *
index 254b2c425b128fc8c37099e499b58b4b66bc8af1..65f3160af383322147d2f00748a04c26fda58b00 100644 (file)
@@ -1,3 +1,7 @@
+2002-10-11  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
+
+       * sh.h: Add SH TLS relocs.
+
 2002-09-30  Gavin Romig-Koch  <gavin@redhat.com>
             Ken Raeburn  <raeburn@cygnus.com>
             Aldy Hernandez  <aldyh@redhat.com>
index af78c9bb04e76ff2308d55e577482579824d7037..ef964d685e8e6786337381581002637b6d6df5b3 100644 (file)
@@ -167,7 +167,17 @@ START_RELOC_NUMBERS (elf_sh_reloc_type)
   RELOC_NUMBER (R_SH_DIR10SL, 50)
   RELOC_NUMBER (R_SH_DIR10SQ, 51)
   FAKE_RELOC (R_SH_FIRST_INVALID_RELOC_3, 52)
-  FAKE_RELOC (R_SH_LAST_INVALID_RELOC_3, 159)
+  FAKE_RELOC (R_SH_LAST_INVALID_RELOC_3, 143)
+  RELOC_NUMBER (R_SH_TLS_GD_32, 144)
+  RELOC_NUMBER (R_SH_TLS_LD_32, 145)
+  RELOC_NUMBER (R_SH_TLS_LDO_32, 146)
+  RELOC_NUMBER (R_SH_TLS_IE_32, 147)
+  RELOC_NUMBER (R_SH_TLS_LE_32, 148)
+  RELOC_NUMBER (R_SH_TLS_DTPMOD32, 149)
+  RELOC_NUMBER (R_SH_TLS_DTPOFF32, 150)
+  RELOC_NUMBER (R_SH_TLS_TPOFF32, 151)
+  FAKE_RELOC (R_SH_FIRST_INVALID_RELOC_4, 152)
+  FAKE_RELOC (R_SH_LAST_INVALID_RELOC_4, 159)
   RELOC_NUMBER (R_SH_GOT32, 160)
   RELOC_NUMBER (R_SH_PLT32, 161)
   RELOC_NUMBER (R_SH_COPY, 162)
@@ -205,8 +215,8 @@ START_RELOC_NUMBERS (elf_sh_reloc_type)
   RELOC_NUMBER (R_SH_GLOB_DAT64, 194)
   RELOC_NUMBER (R_SH_JMP_SLOT64, 195)
   RELOC_NUMBER (R_SH_RELATIVE64, 196)
-  FAKE_RELOC (R_SH_FIRST_INVALID_RELOC_4, 197)
-  FAKE_RELOC (R_SH_LAST_INVALID_RELOC_4, 241)
+  FAKE_RELOC (R_SH_FIRST_INVALID_RELOC_5, 197)
+  FAKE_RELOC (R_SH_LAST_INVALID_RELOC_5, 241)
   RELOC_NUMBER (R_SH_SHMEDIA_CODE, 242)
   RELOC_NUMBER (R_SH_PT_16, 243)
   RELOC_NUMBER (R_SH_IMMS16, 244)
index 0c6470b3ddb9f1e12d1dff146b0a4b47bcb5818f..a99a2290159a9d60cf28c4627cee8cbe28a62a97 100644 (file)
@@ -1,6 +1,6 @@
 /* Declarations for getopt.
-   Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1996, 1997, 1998, 2000
-   Free Software Foundation, Inc.
+   Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1996, 1997, 1998, 2000,
+   2002 Free Software Foundation, Inc.
 
    NOTE: The canonical source of this file is maintained with the GNU C Library.
    Bugs can be reported to bug-glibc@gnu.org.
@@ -108,11 +108,13 @@ struct option
 #if !HAVE_DECL_GETOPT
 #if defined (__GNU_LIBRARY__) || defined (HAVE_DECL_GETOPT)
 /* Many other libraries have conflicting prototypes for getopt, with
-   differences in the consts, in stdlib.h.  To avoid compilation
+   differences in the consts, in unistd.h.  To avoid compilation
    errors, only prototype getopt for the GNU C library.  */
 extern int getopt (int argc, char *const *argv, const char *shortopts);
 #else
+#ifndef __cplusplus
 extern int getopt ();
+#endif /* __cplusplus */
 #endif
 #endif /* !HAVE_DECL_GETOPT */
 
index ab908ec92c37607de9e6e9f50630c4cf93c667e5..af5707e8e88f69711196b7b31f96ab55ea75568b 100644 (file)
@@ -1,3 +1,7 @@
+2002-10-14  Alan Modra  <amodra@bigpond.net.au>
+
+       * cgen.h: Test __BFD_H_SEEN__ rather than BFD_VERSION_DATE.
+
 2002-09-30  Gavin Romig-Koch  <gavin@redhat.com>
             Ken Raeburn  <raeburn@cygnus.com>
             Aldy Hernandez  <aldyh@redhat.com>
index 09c5cbf03a6a93edea1499837978d2da82884b3b..89477985e5d92b92a0e70c02241306a4f2cc15f3 100644 (file)
@@ -26,7 +26,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
    Perhaps the definition of bfd_vma can be moved outside of bfd.h.
    Or perhaps one could duplicate its definition in another file.
    Until such time, this file conditionally compiles definitions that require
-   bfd_vma using BFD_VERSION_DATE.  */
+   bfd_vma using __BFD_H_SEEN__.  */
 
 /* Enums must be defined before they can be used.
    Allow them to be used in struct definitions, even though the enum must
@@ -276,7 +276,7 @@ typedef const char * (cgen_parse_fn)
    PC is the pc value of the insn.
    The result is an error message or NULL if success.  */
 
-#ifdef BFD_VERSION_DATE
+#ifdef __BFD_H_SEEN__
 typedef const char * (cgen_insert_fn)
      PARAMS ((CGEN_CPU_DESC, const CGEN_INSN *insn_,
              CGEN_FIELDS *fields_, CGEN_INSN_BYTES_PTR insnp_,
@@ -297,7 +297,7 @@ typedef const char * (cgen_insert_fn) ();
    PC is the pc value of the insn.
    The result is the length of the insn in bits or zero if not recognized.  */
 
-#ifdef BFD_VERSION_DATE
+#ifdef __BFD_H_SEEN__
 typedef int (cgen_extract_fn)
      PARAMS ((CGEN_CPU_DESC, const CGEN_INSN *insn_,
              CGEN_EXTRACT_INFO *ex_info_, CGEN_INSN_INT base_insn_,
@@ -316,7 +316,7 @@ typedef int (cgen_extract_fn) ();
    PC is the pc value of the insn.
    LEN is the length of the insn, in bits.  */
 
-#ifdef BFD_VERSION_DATE
+#ifdef __BFD_H_SEEN__
 typedef void (cgen_print_fn)
      PARAMS ((CGEN_CPU_DESC, PTR info_, const CGEN_INSN *insn_,
              CGEN_FIELDS *fields_, bfd_vma pc_, int len_));
@@ -381,7 +381,7 @@ enum cgen_parse_operand_result
   CGEN_PARSE_OPERAND_RESULT_ERROR
 };
 
-#ifdef BFD_VERSION_DATE /* Don't require bfd.h unnecessarily.  */
+#ifdef __BFD_H_SEEN__ /* Don't require bfd.h unnecessarily.  */
 typedef const char * (cgen_parse_operand_fn)
      PARAMS ((CGEN_CPU_DESC,
              enum cgen_parse_operand_type, const char **, int, int,
@@ -565,7 +565,7 @@ const CGEN_KEYWORD_ENTRY *cgen_keyword_search_next
 
 extern const char *cgen_parse_keyword
      PARAMS ((CGEN_CPU_DESC, const char **, CGEN_KEYWORD *, long *));
-#ifdef BFD_VERSION_DATE /* Don't require bfd.h unnecessarily.  */
+#ifdef __BFD_H_SEEN__ /* Don't require bfd.h unnecessarily.  */
 extern const char *cgen_parse_signed_integer
      PARAMS ((CGEN_CPU_DESC, const char **, int, long *));
 extern const char *cgen_parse_unsigned_integer
@@ -1253,7 +1253,7 @@ typedef struct cgen_cpu_desc
   const char * (*parse_operand)
      PARAMS ((CGEN_CPU_DESC, int opindex_, const char **,
              CGEN_FIELDS *fields_));
-#ifdef BFD_VERSION_DATE
+#ifdef __BFD_H_SEEN__
   const char * (*insert_operand)
      PARAMS ((CGEN_CPU_DESC, int opindex_, CGEN_FIELDS *fields_,
              CGEN_INSN_BYTES_PTR, bfd_vma pc_));
@@ -1286,7 +1286,7 @@ typedef struct cgen_cpu_desc
        PARAMS ((CGEN_CPU_DESC, int opindex_, const CGEN_FIELDS *fields_));
   void (*set_int_operand)
        PARAMS ((CGEN_CPU_DESC, int opindex_, CGEN_FIELDS *fields_, int value_));
-#ifdef BFD_VERSION_DATE
+#ifdef __BFD_H_SEEN__
   bfd_vma (*get_vma_operand)
        PARAMS ((CGEN_CPU_DESC, int opindex_, const CGEN_FIELDS *fields_));
   void (*set_vma_operand)
index 885a79b4ba3299a52285da16d5f98c754d7063ec..5d3623f716eac5c285523f1cb0425a72ca4e1b2b 100644 (file)
@@ -78,4 +78,8 @@ extern void partition_print             PARAMS((partition,
 #define partition_find(partition__, element__) \
     ((partition__)->elements[(element__)].class_element)
 
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
 #endif /* _PARTITION_H */
index bde129cda841f85d5a76e1887dbb0d02dd072089..4a32a3b298a7c85f8e7c52db7815fbf90b48fae8 100644 (file)
@@ -1,3 +1,13 @@
+2002-10-16  Jakub Jelinek  <jakub@redhat.com>
+
+       * config.table: Use mh-s390pic for s390x too.
+
+2002-10-06  Andreas Jaeger  <aj@suse.de>
+
+       * libiberty/cplus-dem.c (ada_demangle): Get rid of unneeded
+       variable and of strict-aliasing warning.
+       (grow_vect): Use char as first parameter.
+
 2002-09-22  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 
        * Makefile.in (all): Fix multilib parallel build.
index b9a2479aac780ee4e84a01354074b091107f1212..df48ce995253afefe2757c0a4e63142b5554faf8 100644 (file)
@@ -39,6 +39,7 @@ if [ "${shared}" = "yes" ]; then
     powerpc*-*-aix*)   ;;
     powerpc*-*-*)      frag=mh-ppcpic ;;
     sparc*-*-*)                frag=mh-sparcpic ;;
+    s390*-*-*)         frag=mh-s390pic ;;
     *)                 frag=mh-${host_cpu}pic ;;
   esac
   if [ -n "${frag}" ]; then
index 4c4778375b0579b51b80971d43cc494ec743c94d..f42d6181d403b2e06a4d180d769a5a3003c9fc54 100644 (file)
@@ -514,7 +514,7 @@ recursively_demangle PARAMS ((struct work_stuff *, const char **, string *,
                              int));
 
 static void
-grow_vect PARAMS ((void **, size_t *, size_t, int));
+grow_vect PARAMS ((char **, size_t *, size_t, int));
 
 /* Translate count to integer, consuming tokens in the process.
    Conversion terminates on the first non-digit character.
@@ -936,7 +936,7 @@ cplus_demangle (mangled, options)
 
 static void
 grow_vect (old_vect, size, min_size, element_size)
-     void **old_vect;
+     char **old_vect;
      size_t *size;
      size_t min_size;
      int element_size;
@@ -969,8 +969,7 @@ ada_demangle (mangled, option)
   char *demangled = NULL;
   int at_start_name;
   int changed;
-  char *demangling_buffer = NULL;
-  size_t demangling_buffer_size = 0;
+  size_t demangled_size = 0;
   
   changed = 0;
 
@@ -998,10 +997,9 @@ ada_demangle (mangled, option)
     }
   
   /* Make demangled big enough for possible expansion by operator name.  */
-  grow_vect ((void **) &(demangling_buffer),
-            &demangling_buffer_size,  2 * len0 + 1,
+  grow_vect (&demangled,
+            &demangled_size,  2 * len0 + 1,
             sizeof (char));
-  demangled = demangling_buffer;
   
   if (ISDIGIT ((unsigned char) mangled[len0 - 1])) {
     for (i = len0 - 2; i >= 0 && ISDIGIT ((unsigned char) mangled[i]); i -= 1)
@@ -1051,10 +1049,10 @@ ada_demangle (mangled, option)
     return demangled;
   
  Suppress:
-  grow_vect ((void **) &(demangling_buffer),
-            &demangling_buffer_size,  strlen (mangled) + 3,
+  grow_vect (&demangled,
+            &demangled_size,  strlen (mangled) + 3,
             sizeof (char));
-  demangled = demangling_buffer;
+
   if (mangled[0] == '<')
      strcpy (demangled, mangled);
   else
index 6128a7d1cfa4b16a71693c89d45fca5670501d18..558b900aa707a9572d089a18492c43ca95d3afe0 100644 (file)
@@ -1,3 +1,15 @@
+2002-10-07  Nathan Tallent  <eraxxon@alumni.rice.edu>
+
+       * sparc-opc.c (sparc_opcodes) <fb, fba, fbe, fbz, fbg, fbge,
+       fbl, fble, fblg, fbn, fbne, fbnz, fbo, fbu, fbue, fbug, fbuge,
+       fbul, fbule>: Add conditional/unconditional branch
+       classification.
+
+2002-10-13  Stephane Carrez  <stcarrez@nerim.fr>
+
+       * m68hc11-dis.c (print_insn): Treat bitmask and branch operands
+       at the end.
+
 2002-09-30  Gavin Romig-Koch  <gavin@redhat.com>
             Ken Raeburn  <raeburn@cygnus.com>
             Aldy Hernandez  <aldyh@redhat.com>
index c721d16e0c43d3c3a8b032303fcff09554b15b46..bcd3ee5103fd0888593f610f53e66d6b8b64284c 100644 (file)
@@ -495,55 +495,6 @@ print_insn (memaddr, info, arch)
                                 reg_dst_table[(buffer[0] & 7)]);
        }
 
-      /* M6811_OP_BITMASK and M6811_OP_JUMP_REL must be treated separately
-         and in that order.  The brset/brclr insn have a bitmask and then
-         a relative branch offset.  */
-      if (format & M6811_OP_BITMASK)
-       {
-         status = read_memory (memaddr + pos, &buffer[0], 1, info);
-         if (status != 0)
-           {
-             return status;
-           }
-         pos++;
-         (*info->fprintf_func) (info->stream, " #$%02x%s",
-                                buffer[0] & 0x0FF,
-                                (format & M6811_OP_JUMP_REL ? " " : ""));
-         format &= ~M6811_OP_BITMASK;
-       }
-      if (format & M6811_OP_JUMP_REL)
-       {
-         int val;
-
-         status = read_memory (memaddr + pos, &buffer[0], 1, info);
-         if (status != 0)
-           {
-             return status;
-           }
-
-         pos++;
-         val = (buffer[0] & 0x80) ? buffer[0] | 0xFFFFFF00 : buffer[0];
-         (*info->print_address_func) (memaddr + pos + val, info);
-         format &= ~M6811_OP_JUMP_REL;
-       }
-      else if (format & M6812_OP_JUMP_REL16)
-       {
-         int val;
-
-         status = read_memory (memaddr + pos, &buffer[0], 2, info);
-         if (status != 0)
-           {
-             return status;
-           }
-
-         pos += 2;
-         val = ((buffer[0] << 8) | (buffer[1] & 0x0FF));
-         if (val & 0x8000)
-           val |= 0xffff0000;
-
-         (*info->print_address_func) (memaddr + pos + val, info);
-         format &= ~M6812_OP_JUMP_REL16;
-       }
       if (format & (M6811_OP_IMM16 | M6811_OP_IND16))
        {
          int val;
@@ -641,6 +592,56 @@ print_insn (memaddr, info, arch)
          (*info->print_address_func) (val, info);
        }
 
+      /* M6811_OP_BITMASK and M6811_OP_JUMP_REL must be treated separately
+         and in that order.  The brset/brclr insn have a bitmask and then
+         a relative branch offset.  */
+      if (format & M6811_OP_BITMASK)
+       {
+         status = read_memory (memaddr + pos, &buffer[0], 1, info);
+         if (status != 0)
+           {
+             return status;
+           }
+         pos++;
+         (*info->fprintf_func) (info->stream, " #$%02x%s",
+                                buffer[0] & 0x0FF,
+                                (format & M6811_OP_JUMP_REL ? " " : ""));
+         format &= ~M6811_OP_BITMASK;
+       }
+      if (format & M6811_OP_JUMP_REL)
+       {
+         int val;
+
+         status = read_memory (memaddr + pos, &buffer[0], 1, info);
+         if (status != 0)
+           {
+             return status;
+           }
+
+         pos++;
+         val = (buffer[0] & 0x80) ? buffer[0] | 0xFFFFFF00 : buffer[0];
+         (*info->print_address_func) (memaddr + pos + val, info);
+         format &= ~M6811_OP_JUMP_REL;
+       }
+      else if (format & M6812_OP_JUMP_REL16)
+       {
+         int val;
+
+         status = read_memory (memaddr + pos, &buffer[0], 2, info);
+         if (status != 0)
+           {
+             return status;
+           }
+
+         pos += 2;
+         val = ((buffer[0] << 8) | (buffer[1] & 0x0FF));
+         if (val & 0x8000)
+           val |= 0xffff0000;
+
+         (*info->print_address_func) (memaddr + pos + val, info);
+         format &= ~M6812_OP_JUMP_REL16;
+       }
+
       if (format & M6812_OP_PAGE)
        {
          int val;
index 5c06d01df1457f43f3a58205f99b607a2ba11b20..00102323f2b4b1f4e552965957b6f9481c643684 100644 (file)
@@ -1440,25 +1440,25 @@ cond ("bz",     "tz",   CONDZ, F_CONDBR|F_ALIAS), /* for e */
   FBRX(fop, F2(0, 5)|COND(mask), F2(~0, ~5)|COND(~(mask)), flags), /* v9 */ \
   FBR(fop, F2(0, 6)|COND(mask), F2(~0, ~6)|COND(~(mask)), flags)
 
-CONDFC  ("fb",    "cb",    0x8, 0),
-CONDFCL ("fba",          "cba",   0x8, F_ALIAS),
-CONDFC  ("fbe",          "cb0",   0x9, 0),
-CONDF   ("fbz",            0x9, F_ALIAS),
-CONDFC  ("fbg",          "cb2",   0x6, 0),
-CONDFC  ("fbge",  "cb02",  0xb, 0),
-CONDFC  ("fbl",          "cb1",   0x4, 0),
-CONDFC  ("fble",  "cb01",  0xd, 0),
-CONDFC  ("fblg",  "cb12",  0x2, 0),
-CONDFCL ("fbn",          "cbn",   0x0, 0),
-CONDFC  ("fbne",  "cb123", 0x1, 0),
-CONDF   ("fbnz",           0x1, F_ALIAS),
-CONDFC  ("fbo",          "cb012", 0xf, 0),
-CONDFC  ("fbu",          "cb3",   0x7, 0),
-CONDFC  ("fbue",  "cb03",  0xa, 0),
-CONDFC  ("fbug",  "cb23",  0x5, 0),
-CONDFC  ("fbuge", "cb023", 0xc, 0),
-CONDFC  ("fbul",  "cb13",  0x3, 0),
-CONDFC  ("fbule", "cb013", 0xe, 0),
+CONDFC  ("fb",    "cb",    0x8, F_UNBR),
+CONDFCL ("fba",          "cba",   0x8, F_UNBR|F_ALIAS),
+CONDFC  ("fbe",          "cb0",   0x9, F_CONDBR),
+CONDF   ("fbz",            0x9, F_CONDBR|F_ALIAS),
+CONDFC  ("fbg",          "cb2",   0x6, F_CONDBR),
+CONDFC  ("fbge",  "cb02",  0xb, F_CONDBR),
+CONDFC  ("fbl",          "cb1",   0x4, F_CONDBR),
+CONDFC  ("fble",  "cb01",  0xd, F_CONDBR),
+CONDFC  ("fblg",  "cb12",  0x2, F_CONDBR),
+CONDFCL ("fbn",          "cbn",   0x0, F_UNBR),
+CONDFC  ("fbne",  "cb123", 0x1, F_CONDBR),
+CONDF   ("fbnz",           0x1, F_CONDBR|F_ALIAS),
+CONDFC  ("fbo",          "cb012", 0xf, F_CONDBR),
+CONDFC  ("fbu",          "cb3",   0x7, F_CONDBR),
+CONDFC  ("fbue",  "cb03",  0xa, F_CONDBR),
+CONDFC  ("fbug",  "cb23",  0x5, F_CONDBR),
+CONDFC  ("fbuge", "cb023", 0xc, F_CONDBR),
+CONDFC  ("fbul",  "cb13",  0x3, F_CONDBR),
+CONDFC  ("fbule", "cb013", 0xe, F_CONDBR),
 
 #undef CONDFC
 #undef CONDFCL
index ae252fd2769a7841193f0e20b44303d7be5e26b7..eb38a7bf9443a98726bbf81787ead30d400076cd 100644 (file)
@@ -1,3 +1,7 @@
+2002-10-14  Alan Modra  <amodra@bigpond.net.au>
+
+       * cgen-trace.h: Test __BFD_H_SEEN__ rather than BFD_VERSION.
+
 2002-08-29  Dave Brolley  <brolley@redhat.com>
 
        * Make-common.in (CGEN_READ_SCM): Remove ../../cgen/stamp-cgen.
index 5e796fbf061539fdf08946dd2cf4cc5f77981c7e..be1dd1dff4ede7b881076950a6b265cffada5914 100644 (file)
@@ -78,7 +78,7 @@ typedef struct {
 extern int sim_disasm_sprintf (SFILE *, const char *, ...);
 
 /* For opcodes based disassemblers.  */
-#ifdef BFD_VERSION
+#ifdef __BFD_H_SEEN__
 struct disassemble_info;
 extern int
 sim_disasm_read_memory (bfd_vma memaddr_, bfd_byte *myaddr_, int length_,
index ec587595082e10490cd4c0139d6c2d09dd5d5bd3..60b41f7c55253049bcb5f694b21865f3488e2a73 100644 (file)
@@ -1,3 +1,11 @@
+Fri Oct 11 16:22:28 2002  J"orn Rennecke <joern.rennecke@superh.com>
+
+       * interp.c (trap): Return int.  Take extra parameter for address
+       of the trap instruction.  Changed all callers.
+       Add case 33 for profiling.
+       * gencode.c (trapa): Handle trap 33 using the trap function.
+       Add read of vector for generic traps.
+
 Wed Jul 17 19:36:38 2002  J"orn Rennecke <joern.rennecke@superh.com>
 
        * Makefile.in (interp.o): Depend on $(srcroot)/include/gdb/sim-sh.h.
index ba6ee4c1bc6ae1e8914db0235d4b7a82e229cf0e..8e2445a7e11409a5fe2b9e88ec7dab32d264521d 100644 (file)
@@ -577,7 +577,7 @@ op tab[] =
   },
 
   { "", "nm", "mac.l @<REG_M>+,@<REG_N>+", "0000nnnnmmmm1111",
-    "trap (255,R0,memory,maskl,maskw, endianw);",
+    "trap (255, R0, PC, memory, maskl, maskw, endianw);",
     "/* FIXME: mac.l support */",
   },
 
@@ -951,8 +951,7 @@ op tab[] =
   },
 
   { "", "", "sleep", "0000000000011011",
-    "nip = PC;",
-    "trap (0xc3, R0, memory, maskl, maskw, endianw);",
+    "nip += trap (0xc3, R0, PC, memory, maskl, maskw, endianw);",
   },
 
   { "n", "", "stc <CREG_M>,<REG_N>", "0000nnnnmmmm0010",
@@ -1029,37 +1028,25 @@ op tab[] =
   },
 
   { "0", "", "trapa #<imm>", "11000011i8*1....", 
-#if 0
-    /* SH-[12] */
     "long imm = 0xff & i;",
-    "if (i==0xc3)",
-    "  PC-=2;",
-    "if (i<20||i==34||i==0xc3)",
-    "  trap(i,R,memory,maskl,maskw,endianw);",
+    "if (i < 20 || i == 33 || i == 34 || i == 0xc3)",
+    "  nip += trap (i, R, PC, memory, maskl, maskw,endianw);",
+#if 0
     "else {",
+    /* SH-[12] */
     "  R[15]-=4;",
-    "  WLAT(R[15],GET_SR());",
+    "  WLAT (R[15], GET_SR());",
     "  R[15]-=4;",
-    "  WLAT(R[15],PC+2);",
-    "  PC=RLAT(VBR+(imm<<2))-2;",
-    "}",
+    "  WLAT (R[15], PH2T (PC + 2));",
 #else
-    "if (i == 0xc3)",
-    "  {",
-    "    nip = PC;",
-    "    trap (i, R, memory, maskl, maskw,endianw);",
-    "  }",
-    "else if (i < 20 || i==34 || i==0xc3)",
-    "  trap (i, R, memory, maskl, maskw,endianw);",
     "else if (!SR_BL) {",
-    "  /* FIXME: TRA = (imm << 2); */",
     "  SSR = GET_SR();",
     "  SPC = PH2T (PC + 2);",
     "  SET_SR (GET_SR() | SR_MASK_MD | SR_MASK_BL | SR_MASK_RB);",
     "  /* FIXME: EXPEVT = 0x00000160; */",
-    "  SET_NIP (PT2H (VBR + 0x00000100));",
-    "}",
 #endif
+    "  SET_NIP (PT2H (RLAT (VBR + (imm<<2))));",
+    "}",
   },
 
   { "", "mn", "tst <REG_M>,<REG_N>", "0010nnnnmmmm1000",
index 2f5d1d37d596556cd902cd8116686562e8815d3a..8c2f3598a5d5f949a5fdb9c25a7c7c079923d192 100644 (file)
@@ -954,12 +954,14 @@ strnswap (str, len)
   while (start < end);
 }
 
-/* Simulate a monitor trap, put the result into r0 and errno into r1 */
+/* Simulate a monitor trap, put the result into r0 and errno into r1
+   return offset by which to adjust pc.  */
 
-static void
-trap (i, regs, memory, maskl, maskw, endianw)
+static int
+trap (i, regs, insn_ptr, memory, maskl, maskw, endianw)
      int i;
      int *regs;
+     unsigned char *insn_ptr;
      unsigned char *memory;
 {
   switch (i)
@@ -971,6 +973,13 @@ trap (i, regs, memory, maskl, maskw, endianw)
       raise_exception (SIGQUIT);
       break;
     case 3:                    /* FIXME: for backwards compat, should be removed */
+    case 33:
+      {
+       unsigned int countp = * (unsigned int *) (insn_ptr + 4);
+
+       WLAT (countp, RLAT (countp) + 1);
+       return 6;
+      }
     case 34:
       {
        extern int errno;
@@ -1154,9 +1163,11 @@ trap (i, regs, memory, maskl, maskw, endianw)
     case 0xc3:
     case 255:
       raise_exception (SIGTRAP);
+      if (i == 0xc3)
+       return -2;
       break;
     }
-
+  return 0;
 }
 
 void