diff options
author | Fred Fish <fnf@specifix.com> | 1992-06-25 19:10:49 +0000 |
---|---|---|
committer | Fred Fish <fnf@specifix.com> | 1992-06-25 19:10:49 +0000 |
commit | 50e0dc4198cd5a873deeae34cf9718e805049693 (patch) | |
tree | ea0417dd264644957538ae248647eeee87b85ccf /gdb/gdbtypes.c | |
parent | 65967d33edcbb41cc77c35721cdf7698f38748c9 (diff) | |
download | gdb-50e0dc4198cd5a873deeae34cf9718e805049693.zip gdb-50e0dc4198cd5a873deeae34cf9718e805049693.tar.gz gdb-50e0dc4198cd5a873deeae34cf9718e805049693.tar.bz2 |
* 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.
Diffstat (limited to 'gdb/gdbtypes.c')
-rw-r--r-- | gdb/gdbtypes.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index 8af9e85..2407efa 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -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. */ |