* 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.
This commit is contained in:
Fred Fish 1992-06-25 19:10:49 +00:00
parent 65967d33ed
commit 50e0dc4198
6 changed files with 41 additions and 18 deletions

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

View 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. */

View 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. */

View 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 */

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

View 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