remove long long printf crash
[deliverable/binutils-gdb.git] / gdb / buildsym.c
index 806d700ec80194fa0cdf0ea169e573ff6b8c07a0..b104f16e928acf01cf4e3c4968c1b57b5f66a010 100644 (file)
@@ -55,6 +55,10 @@ static struct pending_block *pending_blocks = NULL;
 
 static struct pending *free_pendings;
 
+/* Non-zero if symtab has line number info.  This prevents an otherwise empty
+   symtab from being tossed.  */
+
+static int have_line_numbers;
 \f
 static int
 compare_line_numbers PARAMS ((const void *, const void *));
@@ -96,8 +100,7 @@ add_symbol_to_list (symbol, listhead)
 {
   register struct pending *link;
 
-  /* If this is a reference to/live alias for another symbol, don't add it.
-     We don't want to be able to look up the live references directly. */
+  /* If this is an alias for another symbol, don't add it.  */
   if (symbol->ginfo.name && symbol->ginfo.name[0] == '#')
     return;
       
@@ -714,6 +717,7 @@ record_line (subfile, line, pc)
        xmalloc (sizeof (struct linetable)
          + subfile->line_vector_length * sizeof (struct linetable_entry));
       subfile->line_vector->nitems = 0;
+      have_line_numbers = 1;
     }
 
   if (subfile->line_vector->nitems + 1 >= subfile->line_vector_length)
@@ -770,6 +774,7 @@ start_symtab (name, dirname, start_addr)
   file_symbols = NULL;
   global_symbols = NULL;
   within_function = 0;
+  have_line_numbers = 0;
 
   /* Context stack is initially empty.  Allocate first one with room for
      10 levels; reuse it forever afterward.  */
@@ -886,7 +891,8 @@ end_symtab (end_addr, objfile, section)
 
   if (pending_blocks == NULL
       && file_symbols == NULL
-      && global_symbols == NULL)
+      && global_symbols == NULL
+      && have_line_numbers == 0)
     {
       /* Ignore symtabs that have no functions with real debugging info */
       blockvector = NULL;
This page took 0.023361 seconds and 4 git commands to generate.