diff options
author | Doug Evans <dje@google.com> | 2013-08-20 18:57:00 +0000 |
---|---|---|
committer | Doug Evans <dje@google.com> | 2013-08-20 18:57:00 +0000 |
commit | fc474241b7996b9ebdd4f83f52692096637c5620 (patch) | |
tree | 3a1f9390110ec58d04b244e8bade92befc60bd19 /gdb/coffread.c | |
parent | bec71544ee9433508b970323621e4a1d19656ba1 (diff) | |
download | gdb-fc474241b7996b9ebdd4f83f52692096637c5620.zip gdb-fc474241b7996b9ebdd4f83f52692096637c5620.tar.gz gdb-fc474241b7996b9ebdd4f83f52692096637c5620.tar.bz2 |
* buildsym.c (subfile_stack): Move here from buildsym.h.
(pending_macros): Ditto.
(get_macro_table): New function.
(buildsym_init): Initialize subfile_stack.
* coffread.c (type_vector,type_vector_length): Moved here from
buildsym.h.
(INITIAL_TYPE_VECTOR_LENGTH): Ditto.
(coff_symtab_read): Use it.
* dbxread.c (read_ofile_symtab): Delete init of subfile_stack.
* dwarf2read.c (macro_start_file): Replace uses of pending_macros
with call to get_macro_table.
* stabsread.c (type_vector,type_vector_length): Moved here from
buildsym.h.
(INITIAL_TYPE_VECTOR_LENGTH): Ditto.
* buildsym.h (get_macro_table): Declare.
Diffstat (limited to 'gdb/coffread.c')
-rw-r--r-- | gdb/coffread.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/gdb/coffread.c b/gdb/coffread.c index 1402247..7ade38c 100644 --- a/gdb/coffread.c +++ b/gdb/coffread.c @@ -146,6 +146,19 @@ struct coff_symbol unsigned int c_type; }; +/* Vector of types defined so far, indexed by their type numbers. */ + +static struct type **type_vector; + +/* Number of elements allocated for type_vector currently. */ + +static int type_vector_length; + +/* Initial size of type vector. Is realloc'd larger if needed, and + realloc'd down to the size actually used, when completed. */ + +#define INITIAL_TYPE_VECTOR_LENGTH 160 + extern void stabsread_clear_cache (void); static struct type *coff_read_struct_type (int, int, int, @@ -816,7 +829,7 @@ coff_symtab_read (long symtab_offset, unsigned int nsyms, if (type_vector) /* Get rid of previous one. */ xfree (type_vector); - type_vector_length = 160; + type_vector_length = INITIAL_TYPE_VECTOR_LENGTH; type_vector = (struct type **) xmalloc (type_vector_length * sizeof (struct type *)); memset (type_vector, 0, type_vector_length * sizeof (struct type *)); |