summaryrefslogtreecommitdiffstats
path: root/gdb/stabsread.c
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@gnat.com>2003-12-05 00:45:39 +0000
committerJoel Brobecker <brobecker@gnat.com>2003-12-05 00:45:39 +0000
commit149d821b1e3bb285001cde4b8b42e006e26fca71 (patch)
tree48694551cf55c8a6d4d868721d0120666abb1401 /gdb/stabsread.c
parentd97d0546d30a25ea1adc960b57b4feec7fc4a02d (diff)
downloadppe42-binutils-149d821b1e3bb285001cde4b8b42e006e26fca71.tar.gz
ppe42-binutils-149d821b1e3bb285001cde4b8b42e006e26fca71.zip
* stabsread.c (read_type): Save a reference to types that are defined
as cross references to other types.
Diffstat (limited to 'gdb/stabsread.c')
-rw-r--r--gdb/stabsread.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/gdb/stabsread.c b/gdb/stabsread.c
index 14b4b45eeb..2567b468ff 100644
--- a/gdb/stabsread.c
+++ b/gdb/stabsread.c
@@ -1564,11 +1564,9 @@ again:
*pp = from + 1;
}
- /* Now check to see whether the type has already been
- declared. This was written for arrays of cross-referenced
- types before we had TYPE_CODE_TARGET_STUBBED, so I'm pretty
- sure it is not necessary anymore. But it might be a good
- idea, to save a little memory. */
+ /* If this type has already been declared, then reuse the same
+ type, rather than allocating a new one. This saves some
+ memory. */
for (ppt = file_symbols; ppt; ppt = ppt->next)
for (i = 0; i < ppt->nsyms; i++)
@@ -1582,6 +1580,8 @@ again:
{
obstack_free (&objfile->type_obstack, type_name);
type = SYMBOL_TYPE (sym);
+ if (typenums[0] != -1)
+ *dbx_lookup_type (typenums) = type;
return type;
}
}
OpenPOWER on IntegriCloud