* mipsread.c: Pass NULL name pointer to init_type, not 0.
authorFred Fish <fnf@specifix.com>
Thu, 25 Jun 1992 19:10:49 +0000 (19:10 +0000)
committerFred Fish <fnf@specifix.com>
Thu, 25 Jun 1992 19:10:49 +0000 (19:10 +0000)
* gdbtypes.c (init_type):  Use copy of typename on type_obstack.
* dwarfread.c (enum_type):  Save enum names on type_obstack.
* dwarfread.c (struct_type):  Save member name on type_obstack.
* symtab.c (_initialize_symtab):  Fix misspelling.
* regex.c (store_jump, insert_jump):  Return void.

gdb/ChangeLog
gdb/dwarfread.c
gdb/gdbtypes.c
gdb/mipsread.c
gdb/regex.c
gdb/symtab.c

index afd576b6ccb9a945f8246a6f9e08f97198563354..5cf89e9a2d61230ddb17d33b4dc766f97d75882e 100644 (file)
@@ -1,3 +1,12 @@
+Thu Jun 25 12:06:00 1992  Fred Fish  (fnf@cygnus.com)
+
+       * mipsread.c:  Pass NULL name pointer to init_type, not 0.
+       * gdbtypes.c (init_type):  Use copy of typename on type_obstack.
+       * dwarfread.c (enum_type):  Save enum names on type_obstack.
+       * dwarfread.c (struct_type):  Save member name on type_obstack.
+       * symtab.c (_initialize_symtab):  Fix misspelling.
+       * regex.c (store_jump, insert_jump):  Return void.
+
 Thu Jun 25 04:00:10 1992  John Gilmore  (gnu at cygnus.com)
 
        * defs.h (PARAMS):  Move to ../include/ansidecl.h.
index eb120bc3c66f3233373ee7e9c28dc334f2be90da..3c7c20163483c13ceb998b06728533baf38ca541 100644 (file)
@@ -853,7 +853,9 @@ struct_type (dip, thisdie, enddie, objfile)
          new -> next = list;
          list = new;
          /* Save the data.  */
-         list -> field.name = savestring (mbr.at_name, strlen (mbr.at_name));
+         list -> field.name =
+             obsavestring (mbr.at_name, strlen (mbr.at_name),
+                           &objfile -> type_obstack);
          list -> field.type = decode_die_type (&mbr);
          list -> field.bitpos = 8 * locval (mbr.at_location);
          /* Handle bit fields. */
@@ -1440,7 +1442,8 @@ enum_type (dip, objfile)
            target_to_host (scan, TARGET_FT_LONG_SIZE (objfile), GET_SIGNED,
                            objfile);
          scan += TARGET_FT_LONG_SIZE (objfile);
-         list -> field.name = savestring (scan, strlen (scan));
+         list -> field.name = obsavestring (scan, strlen (scan),
+                                            &objfile -> type_obstack);
          scan += strlen (scan) + 1;
          nfields++;
          /* Handcraft a new symbol for this enum member. */
index 8af9e8539e723f423a4f38d8dd35098b05dc2181..2407efac1c31e79175c2db3e4d17b3164bc994d2 100644 (file)
@@ -845,7 +845,12 @@ allocate_cplus_struct_type (type)
     }
 }
 
-/* Helper function to initialize the standard scalar types.  */
+/* Helper function to initialize the standard scalar types.
+
+   If NAME is non-NULL and OBJFILE is non-NULL, then we make a copy
+   of the string pointed to by name in the type_obstack for that objfile,
+   and initialize the type name to that copy.  There are places (mipsread.c
+   in particular, where init_type is called with a NULL value for NAME). */
 
 struct type *
 init_type (code, length, flags, name, objfile)
@@ -861,7 +866,15 @@ init_type (code, length, flags, name, objfile)
   TYPE_CODE (type) = code;
   TYPE_LENGTH (type) = length;
   TYPE_FLAGS (type) |= flags;
-  TYPE_NAME (type) = name;
+  if ((name != NULL) && (objfile != NULL))
+    {
+      TYPE_NAME (type) =
+       obsavestring (name, strlen (name), &objfile -> type_obstack);
+    }
+  else
+    {
+      TYPE_NAME (type) = name;
+    }
 
   /* C++ fancies.  */
 
index 89fe0500e22244df96a70a59114cd5f253fca2cd..dd3171e0648f30616444fd619d1fb7afa5afc1fd 100644 (file)
@@ -67,12 +67,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include <sys/param.h>
 #include <sys/file.h>
 #include <sys/stat.h>
-#include <strings.h>
-
-/* Undo brain-damage in some <strings.h> that '#define index strchr'.
-   Note that tm-mips.h includes coff/sym.h, which has a structure with a
-   member named 'index'. */
-#undef index
 
 #include "coff/mips.h"         /* COFF-like aspects of ecoff files */
 #include "coff/ecoff-ext.h"    /* External forms of ecoff sym structures */
@@ -1455,7 +1449,8 @@ parse_type(ax, bs, bigend)
                ax += cross_ref(ax, &tp, type_code, &pn, bigend);
                /* reading .o file ? */
                if (UNSAFE_DATA_ADDR(tp))
-                   tp = init_type(type_code, 0, 0, 0, (struct objfile *) NULL);
+                   tp = init_type(type_code, 0, 0, (char *) NULL,
+                                  (struct objfile *) NULL);
                /* SOMEONE OUGHT TO FIX DBXREAD TO DROP "STRUCT" */
                sprintf(name, fmt, pn);
 
@@ -1545,7 +1540,8 @@ upgrade_type(tpp, tq, ax, bigend)
 
        case tqArray:
                off = 0;
-               t = init_type(TYPE_CODE_ARRAY, 0, 0, 0, (struct objfile *) NULL);
+               t = init_type(TYPE_CODE_ARRAY, 0, 0, (char *) NULL,
+                             (struct objfile *) NULL);
                TYPE_TARGET_TYPE(t) = *tpp;
 
                /* Determine and record the domain type (type of index) */
@@ -2580,7 +2576,8 @@ cross_ref(ax, tpp, type_code, pname, bigend)
                    if (p)
                        *tpp = p->t;
                    else {
-                       *tpp = init_type(type_code, 0, 0, 0, (struct objfile *) NULL);
+                       *tpp = init_type(type_code, 0, 0, (char *) NULL,
+                                        (struct objfile *) NULL);
                        add_pending(fh, sh, *tpp);
                    }
                }
@@ -2997,7 +2994,8 @@ fixup_sigtramp()
         */
        SYMBOL_NAMESPACE(s) = VAR_NAMESPACE;
        SYMBOL_CLASS(s) = LOC_BLOCK;
-       SYMBOL_TYPE(s) = init_type(TYPE_CODE_FUNC, 4, 0, 0, (struct objfile *) NULL);
+       SYMBOL_TYPE(s) = init_type(TYPE_CODE_FUNC, 4, 0, (char *) NULL,
+                                  (struct objfile *) NULL);
        TYPE_TARGET_TYPE(SYMBOL_TYPE(s)) = builtin_type_void;
 
        /* Need a block to allocate .gdbinfo. in */
index a4c9e26b5cb67f83185ab58dcc02fd9ef0d66d21..59695cfd8d344ec5449bdeafac0a1382c594d9fd 100644 (file)
@@ -177,7 +177,7 @@ re_set_syntax (syntax)
       pending_exact += c; \
   }
 
-static int store_jump (), insert_jump ();
+static void store_jump (), insert_jump ();
 
 char *
 re_compile_pattern (pattern, size, bufp)
@@ -659,7 +659,7 @@ re_compile_pattern (pattern, size, bufp)
 /* Store where `from' points a jump operation to jump to where `to' points.
   `opcode' is the opcode to store. */
 
-static int
+static void
 store_jump (from, opcode, to)
      char *from, *to;
      char opcode;
@@ -676,7 +676,7 @@ store_jump (from, opcode, to)
 
    If you call this function, you must zero out pending_exact.  */
 
-static int
+static void
 insert_jump (op, from, to, current_end)
      char op;
      char *from, *to, *current_end;
index 82a0413c5480ee269ca47e093f554b4bc731c64a..7c7f3b03d9a1105c7ae5498a87216a055be9afcd 100644 (file)
@@ -2782,7 +2782,7 @@ _initialize_symtab ()
 #if 0
   add_info ("methods", methods_info,
            "All method names, or those matching REGEXP::REGEXP.\n\
-If the class qualifier is ommited, it is assumed to be the current scope.\n\
+If the class qualifier is omitted, it is assumed to be the current scope.\n\
 If the first REGEXP is omitted, then all methods matching the second REGEXP\n\
 are listed.");
 #endif
This page took 0.047765 seconds and 4 git commands to generate.