Move current_subfile to buildsym_compunit
[deliverable/binutils-gdb.git] / gdb / xcoffread.c
index f9f19e7cbcab8bfa484d69ddba9d49edb263cace..98efa969c3821123182d271acb8d2edf7519ec03 100644 (file)
@@ -713,6 +713,7 @@ process_linenos (CORE_ADDR start, CORE_ADDR end)
       /* Line numbers are not necessarily ordered.  xlc compilation will
          put static function to the end.  */
 
+      struct subfile *current_subfile = get_current_subfile ();
       lineTb = arrange_linetable (lv);
       if (lv == lineTb)
        {
@@ -775,8 +776,9 @@ process_linenos (CORE_ADDR start, CORE_ADDR end)
            if (fakename == NULL)
              fakename = " ?";
            start_subfile (fakename);
-           xfree (current_subfile->name);
+           xfree (get_current_subfile ()->name);
          }
+         struct subfile *current_subfile = get_current_subfile ();
          current_subfile->name = xstrdup (inclTable[ii].name);
 #endif
 
@@ -1391,23 +1393,23 @@ read_xcoff_symtab (struct objfile *objfile, struct partial_symtab *pst)
              /* { main_aux.x_sym.x_misc.x_lnsz.x_lnno
                 contains number of lines to '}' */
 
-             if (context_stack_depth <= 0)
+             if (outermost_context_p ())
                {       /* We attempted to pop an empty context stack.  */
                  ef_complaint (cs->c_symnum);
                  within_function = 0;
                  break;
                }
-             newobj = pop_context ();
+             struct context_stack cstk = pop_context ();
              /* Stack must be empty now.  */
-             if (context_stack_depth > 0 || newobj == NULL)
+             if (!outermost_context_p ())
                {
                  ef_complaint (cs->c_symnum);
                  within_function = 0;
                  break;
                }
 
-             finish_block (newobj->name, &local_symbols, newobj->old_blocks,
-                           NULL, newobj->start_addr,
+             finish_block (cstk.name, &local_symbols, cstk.old_blocks,
+                           NULL, cstk.start_addr,
                            (fcn_cs_saved.c_value
                             + fcn_aux_saved.x_sym.x_misc.x_fsize
                             + ANOFFSET (objfile->section_offsets,
@@ -1483,28 +1485,28 @@ read_xcoff_symtab (struct objfile *objfile, struct partial_symtab *pst)
            }
          else if (strcmp (cs->c_name, ".eb") == 0)
            {
-             if (context_stack_depth <= 0)
+             if (outermost_context_p ())
                {       /* We attempted to pop an empty context stack.  */
                  eb_complaint (cs->c_symnum);
                  break;
                }
-             newobj = pop_context ();
-             if (depth-- != newobj->depth)
+             struct context_stack cstk = pop_context ();
+             if (depth-- != cstk.depth)
                {
                  eb_complaint (cs->c_symnum);
                  break;
                }
-             if (local_symbols && context_stack_depth > 0)
+             if (local_symbols && !outermost_context_p ())
                {
                  /* Make a block for the local symbols within.  */
-                 finish_block (newobj->name, &local_symbols,
-                               newobj->old_blocks, NULL,
-                               newobj->start_addr,
+                 finish_block (cstk.name, &local_symbols,
+                               cstk.old_blocks, NULL,
+                               cstk.start_addr,
                                (cs->c_value
                                 + ANOFFSET (objfile->section_offsets,
                                             SECT_OFF_TEXT (objfile))));
                }
-             local_symbols = newobj->locals;
+             local_symbols = cstk.locals;
            }
          break;
 
This page took 0.024637 seconds and 4 git commands to generate.