X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=gdb%2Fbuildsym.c;h=58eb157e6116da5de0185a7115a0f11844df2963;hb=021a5c6b014172a7261e8b080ebc049d6a60a200;hp=48b1a82374270b628116de0feba682d918007ef0;hpb=996ccb3043d9237ea8e6e79d6a7c6121b15f9e61;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/buildsym.c b/gdb/buildsym.c index 48b1a82374..58eb157e61 100644 --- a/gdb/buildsym.c +++ b/gdb/buildsym.c @@ -39,6 +39,10 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "buildsym.h" /* Our own declarations */ #undef EXTERN +/* For cleanup_undefined_types and finish_global_stabs (somewhat + questionable--see comment where we call them). */ +#include "stabsread.h" + static int compare_line_numbers PARAMS ((const void *, const void *)); @@ -62,7 +66,7 @@ struct complaint innerblock_anon_complaint = {"inner block not inside outer block", 0, 0}; struct complaint blockvector_complaint = - {"block at 0x%x out of order", 0, 0}; + {"block at 0x%lx out of order", 0, 0}; /* maintain the lists of symbols and blocks */ @@ -348,7 +352,7 @@ make_blockvector (objfile) > BLOCK_START(BLOCKVECTOR_BLOCK (blockvector, i))) { complain (&blockvector_complaint, - BLOCK_START(BLOCKVECTOR_BLOCK (blockvector, i))); + (unsigned long) BLOCK_START(BLOCKVECTOR_BLOCK (blockvector, i))); } } } @@ -422,18 +426,15 @@ start_subfile (name, dirname) directives which specify a file name ending in .C. So if the filename of this subfile ends in .C, then change the language - of any pending subfiles from C to C++. .cc is also accepted, even - though I don't think cfront allows it. */ + of any pending subfiles from C to C++. We also accept any other C++ + suffixes accepted by deduce_language_from_filename (in particular, + some people use .cxx with cfront). */ if (subfile->name) { - char *p; struct subfile *s; - p = strrchr (subfile->name, '.'); - if (p != NULL - && ((p[1] == 'C' && p[2] == '\0') - || (p[1] == 'c' && p[2] == 'c' && p[3] == '\0'))) + if (deduce_language_from_filename (subfile->name) == language_cplus) for (s = subfiles; s != NULL; s = s->next) if (s->language == language_c) s->language = language_cplus; @@ -653,7 +654,7 @@ end_symtab (end_addr, sort_pending, sort_linevec, objfile, section) struct objfile *objfile; int section; { - register struct symtab *symtab; + register struct symtab *symtab = NULL; register struct blockvector *blockvector; register struct subfile *subfile; register struct context_stack *cstk; @@ -670,11 +671,16 @@ end_symtab (end_addr, sort_pending, sort_linevec, objfile, section) finish_block (cstk->name, &local_symbols, cstk->old_blocks, cstk->start_addr, end_addr, objfile); - /* Debug: if context stack still has something in it, - we are in trouble. */ if (context_stack_depth > 0) { - abort (); + /* This is said to happen with SCO. The old coffread.c code + simply emptied the context stack, so we do the same. FIXME: + Find out why it is happening. This is not believed to happen + in most cases (even for coffread.c); it used to be an abort(). */ + static struct complaint msg = + {"Context stack not empty in end_symtab", 0, 0}; + complain (&msg); + context_stack_depth = 0; } } @@ -751,7 +757,7 @@ end_symtab (end_addr, sort_pending, sort_linevec, objfile, section) for (subfile = subfiles; subfile; subfile = nextsub) { - int linetablesize; + int linetablesize = 0; /* If we have blocks of symbols, make a symtab. Otherwise, just ignore this file and any line number info in it. */ symtab = NULL;