diff options
author | Joel Brobecker <brobecker@gnat.com> | 2003-12-05 00:45:39 +0000 |
---|---|---|
committer | Joel Brobecker <brobecker@gnat.com> | 2003-12-05 00:45:39 +0000 |
commit | 568118234c2cd4c3af6636dcebdd9f7bf7eb195e (patch) | |
tree | bbf5612b82f6a5d899c0c4932d623d1995c41b07 /gdb | |
parent | 0a90884b4eb82f73b19b6699015c3658fd645227 (diff) | |
download | gdb-568118234c2cd4c3af6636dcebdd9f7bf7eb195e.tar.gz |
* stabsread.c (read_type): Save a reference to types that are defined
as cross references to other types.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/stabsread.c | 10 |
2 files changed, 10 insertions, 5 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 8480ae23884..b61514e5305 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2003-12-04 J. Brobecker <brobecker@gnat.com> + + * stabsread.c (read_type): Save a reference to types that are defined + as cross references to other types. + 2003-12-02 Roland McGrath <roland@redhat.com> * thread-db.c (enable_thread_event): Change return type to diff --git a/gdb/stabsread.c b/gdb/stabsread.c index 14b4b45eeb0..2567b468ffe 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; } } |