* 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 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.
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. */
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. */
}
}
-/* 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)
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. */
#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 */
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);
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) */
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);
}
}
*/
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 */
pending_exact += c; \
}
-static int store_jump (), insert_jump ();
+static void store_jump (), insert_jump ();
char *
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;
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;
#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