Move pending_blocks and pending_block_obstack to buildsym_compunit
[deliverable/binutils-gdb.git] / gdb / dbxread.c
index 5d4b97858a05de10aa9058a63d032d81a687e6f9..b5cec28ae48b69aeb12dbc812e9c3e42f96bbe13 100644 (file)
@@ -2448,6 +2448,7 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, const char *name,
 {
   struct gdbarch *gdbarch = get_objfile_arch (objfile);
   struct context_stack *newobj;
+  struct context_stack cstk;
   /* This remembers the address of the start of a function.  It is
      used because in Solaris 2, N_LBRAC, N_RBRAC, and N_SLINE entries
      are relative to the current function's start address.  On systems
@@ -2493,7 +2494,7 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, const char *name,
             the current block.  */
          struct block *block;
 
-         if (context_stack_depth <= 0)
+         if (outermost_context_p ())
            {
              lbrac_mismatch_complaint (symnum);
              break;
@@ -2507,21 +2508,21 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, const char *name,
            {
              CORE_ADDR addr = last_function_start + valu;
 
-             record_line (current_subfile, 0,
+             record_line (get_current_subfile (), 0,
                           gdbarch_addr_bits_remove (gdbarch, addr));
            }
 
          within_function = 0;
-         newobj = pop_context ();
+         cstk = pop_context ();
 
          /* Make a block for the local symbols within.  */
-         block = finish_block (newobj->name, &local_symbols,
-                               newobj->old_blocks, NULL,
-                               newobj->start_addr, newobj->start_addr + valu);
+         block = finish_block (cstk.name, &local_symbols,
+                               cstk.old_blocks, NULL,
+                               cstk.start_addr, cstk.start_addr + valu);
 
          /* For C++, set the block's scope.  */
-         if (SYMBOL_LANGUAGE (newobj->name) == language_cplus)
-           cp_set_block_scope (newobj->name, block, &objfile->objfile_obstack);
+         if (SYMBOL_LANGUAGE (cstk.name) == language_cplus)
+           cp_set_block_scope (cstk.name, block, &objfile->objfile_obstack);
 
          /* May be switching to an assembler file which may not be using
             block relative stabs, so reset the offset.  */
@@ -2562,14 +2563,14 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, const char *name,
 
       valu += function_start_offset;
 
-      if (context_stack_depth <= 0)
+      if (outermost_context_p ())
        {
          lbrac_mismatch_complaint (symnum);
          break;
        }
 
-      newobj = pop_context ();
-      if (desc != newobj->depth)
+      cstk = pop_context ();
+      if (desc != cstk.depth)
        lbrac_mismatch_complaint (symnum);
 
       if (local_symbols != NULL)
@@ -2581,9 +2582,9 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, const char *name,
          complaint (_("misplaced N_LBRAC entry; discarding local "
                       "symbols which have no enclosing block"));
        }
-      local_symbols = newobj->locals;
+      local_symbols = cstk.locals;
 
-      if (context_stack_depth > 1)
+      if (get_context_stack_depth () > 1)
        {
          /* This is not the outermost LBRAC...RBRAC pair in the
             function, its local symbols preceded it, and are the ones
@@ -2596,14 +2597,14 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, const char *name,
              /* Muzzle a compiler bug that makes end < start.
 
                 ??? Which compilers?  Is this ever harmful?.  */
-             if (newobj->start_addr > valu)
+             if (cstk.start_addr > valu)
                {
                  complaint (_("block start larger than block end"));
-                 newobj->start_addr = valu;
+                 cstk.start_addr = valu;
                }
              /* Make a block for the local symbols within.  */
-             finish_block (0, &local_symbols, newobj->old_blocks, NULL,
-                           newobj->start_addr, valu);
+             finish_block (0, &local_symbols, cstk.old_blocks, NULL,
+                           cstk.start_addr, valu);
            }
        }
       else
@@ -2641,7 +2642,7 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, const char *name,
             name.  Patch things up.  */
          if (previous_stab_code == (unsigned char) N_SO)
            {
-             patch_subfile_names (current_subfile, name);
+             patch_subfile_names (get_current_subfile (), name);
              break;            /* Ignore repeated SOs.  */
            }
          end_symtab (valu, SECT_OFF_TEXT (objfile));
@@ -2711,12 +2712,12 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, const char *name,
          CORE_ADDR addr = processing_gcc_compilation == 2 ?
                           last_function_start : valu;
 
-         record_line (current_subfile, desc,
+         record_line (get_current_subfile (), desc,
                       gdbarch_addr_bits_remove (gdbarch, addr));
          sline_found_in_function = 1;
        }
       else
-       record_line (current_subfile, desc,
+       record_line (get_current_subfile (), desc,
                     gdbarch_addr_bits_remove (gdbarch, valu));
       break;
 
@@ -2876,26 +2877,26 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, const char *name,
 
              within_function = 1;
 
-             if (context_stack_depth > 1)
+             if (get_context_stack_depth () > 1)
                {
                  complaint (_("unmatched N_LBRAC before symtab pos %d"),
                             symnum);
                  break;
                }
 
-             if (context_stack_depth > 0)
+             if (!outermost_context_p ())
                {
                  struct block *block;
 
-                 newobj = pop_context ();
+                 cstk = pop_context ();
                  /* Make a block for the local symbols within.  */
-                 block = finish_block (newobj->name, &local_symbols,
-                                       newobj->old_blocks, NULL,
-                                       newobj->start_addr, valu);
+                 block = finish_block (cstk.name, &local_symbols,
+                                       cstk.old_blocks, NULL,
+                                       cstk.start_addr, valu);
 
                  /* For C++, set the block's scope.  */
-                 if (SYMBOL_LANGUAGE (newobj->name) == language_cplus)
-                   cp_set_block_scope (newobj->name, block,
+                 if (SYMBOL_LANGUAGE (cstk.name) == language_cplus)
+                   cp_set_block_scope (cstk.name, block,
                                        &objfile->objfile_obstack);
                }
 
This page took 0.049654 seconds and 4 git commands to generate.