diff options
author | Stan Shebs <shebs@codesourcery.com> | 1994-09-03 00:32:08 +0000 |
---|---|---|
committer | Stan Shebs <shebs@codesourcery.com> | 1994-09-03 00:32:08 +0000 |
commit | 7f4c859520eb131486e73c298b45a88d87c3be89 (patch) | |
tree | 41efcee64e3d387846ea7e8c52a6efcd6ba9fad9 /gdb/xcoffread.c | |
parent | ed617881e344716a2e8177ae59ee3d4b8e596e93 (diff) | |
download | gdb-7f4c859520eb131486e73c298b45a88d87c3be89.zip gdb-7f4c859520eb131486e73c298b45a88d87c3be89.tar.gz gdb-7f4c859520eb131486e73c298b45a88d87c3be89.tar.bz2 |
* objfiles.c (allocate_objfile): Add the newly-created objfile to
the end of the list of objfiles, instead of at the beginning.
* xcoffread.c (allocate_include_entry): New function, abstracted
from code in record_include_begin.
(record_include_begin, record_include_end): Call it.
* blockframe.c (reinit_frame_cache): Test inferior_pid instead of
target_has_stack to decide whether to create a real stack frame
for the cache.
* coffread.c (process_coff_symbol) [CXUX_TARGET]: Ignore vendor
section.
* config/m88k/tm-cxux.h (CXUX_TARGET): Define.
* h8300-tdep.c: Include "dis-asm.h" instead of <dis-asm.h>.
Diffstat (limited to 'gdb/xcoffread.c')
-rw-r--r-- | gdb/xcoffread.c | 45 |
1 files changed, 27 insertions, 18 deletions
diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c index 50a3e29..a40aa8f 100644 --- a/gdb/xcoffread.c +++ b/gdb/xcoffread.c @@ -400,6 +400,7 @@ static int inclIndx; /* last entry to table */ static int inclLength; /* table length */ static int inclDepth; /* nested include depth */ +static void allocate_include_entry PARAMS ((void)); static void record_include_begin (cs) @@ -418,27 +419,12 @@ struct coff_symbol *cs; } ++inclDepth; - /* allocate an include file, or make room for the new entry */ - if (inclLength == 0) { - inclTable = (InclTable*) - xmalloc (sizeof (InclTable) * INITIAL_INCLUDE_TABLE_LENGTH); - memset (inclTable, '\0', sizeof (InclTable) * INITIAL_INCLUDE_TABLE_LENGTH); - inclLength = INITIAL_INCLUDE_TABLE_LENGTH; - inclIndx = 0; - } - else if (inclIndx >= inclLength) { - inclLength += INITIAL_INCLUDE_TABLE_LENGTH; - inclTable = (InclTable*) - xrealloc (inclTable, sizeof (InclTable) * inclLength); - memset (inclTable+inclLength-INITIAL_INCLUDE_TABLE_LENGTH, - '\0', sizeof (InclTable)*INITIAL_INCLUDE_TABLE_LENGTH); - } + allocate_include_entry (); inclTable [inclIndx].name = cs->c_name; inclTable [inclIndx].begin = cs->c_value; } - static void record_include_end (cs) struct coff_symbol *cs; @@ -451,6 +437,8 @@ struct coff_symbol *cs; complain (&msg); } + allocate_include_entry (); + pTbl = &inclTable [inclIndx]; pTbl->end = cs->c_value; @@ -458,9 +446,30 @@ struct coff_symbol *cs; ++inclIndx; } +static void +allocate_include_entry () +{ + if (inclTable == NULL) + { + inclTable = (InclTable *) + xmalloc (sizeof (InclTable) * INITIAL_INCLUDE_TABLE_LENGTH); + memset (inclTable, + '\0', sizeof (InclTable) * INITIAL_INCLUDE_TABLE_LENGTH); + inclLength = INITIAL_INCLUDE_TABLE_LENGTH; + inclIndx = 0; + } + else if (inclIndx >= inclLength) + { + inclLength += INITIAL_INCLUDE_TABLE_LENGTH; + inclTable = (InclTable *) + xrealloc (inclTable, sizeof (InclTable) * inclLength); + memset (inclTable + inclLength - INITIAL_INCLUDE_TABLE_LENGTH, + '\0', sizeof (InclTable)*INITIAL_INCLUDE_TABLE_LENGTH); + } +} -/* given the start and end addresses of a compilation unit (or a csect, at times) - process its lines and create appropriate line vectors. */ +/* given the start and end addresses of a compilation unit (or a csect, + at times) process its lines and create appropriate line vectors. */ static void process_linenos (start, end) |