* gdb.texinfo (Command Files): Mention -x, use @enumerate for
[deliverable/binutils-gdb.git] / gdb / partial-stab.h
index 2a8c01075c8ebeddc9286ef19d4543e39ef6e17c..9c4be680a2b253b84138530384a780eee0fa21bd 100644 (file)
@@ -24,7 +24,6 @@
    CUR_SYMBOL_TYPE --Type code of current symbol.
    CUR_SYMBOL_VALUE --Value field of current symbol.  May be adjusted here.
    namestring - variable pointing to the name of the stab.
-   section_offsets - variable pointing to the section offsets.
    pst - the partial symbol table being built.
 
    psymtab_include_list, includes_used, includes_allocated - list of include
@@ -266,7 +265,7 @@ switch (CUR_SYMBOL_TYPE)
          immediately follow the first.  */
 
       if (!pst)
-       pst = START_PSYMTAB (objfile, objfile->section_offsets,
+       pst = START_PSYMTAB (objfile,
                             namestring, valu,
                             first_so_symnum * symbol_size,
                             objfile->global_psymbols.next,
@@ -394,7 +393,7 @@ switch (CUR_SYMBOL_TYPE)
 
 #ifdef DBXREAD_ONLY
     /* See if this is an end of function stab.  */
-    if (CUR_SYMBOL_TYPE == N_FUN && *namestring == '\000')
+    if (pst && CUR_SYMBOL_TYPE == N_FUN && *namestring == '\000')
       {
        unsigned long valu;
 
@@ -578,9 +577,6 @@ switch (CUR_SYMBOL_TYPE)
       case 'f':
        CUR_SYMBOL_VALUE += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
 #ifdef DBXREAD_ONLY
-       /* Keep track of the start of the last function so we
-          can handle end of function symbols.  */
-       last_function_start = CUR_SYMBOL_VALUE;
        /* Kludges for ELF/STABS with Sun ACC */
        last_function_name = namestring;
 #ifdef SOFUN_ADDRESS_MAYBE_MISSING
@@ -589,12 +585,16 @@ switch (CUR_SYMBOL_TYPE)
        if (pst && textlow_not_set)
          {
            pst->textlow =
-             find_stab_function_addr (namestring, pst, objfile);
+             find_stab_function_addr (namestring, pst->filename, objfile);
            textlow_not_set = 0;
          }
 #endif
        /* End kludge.  */
 
+       /* Keep track of the start of the last function so we
+          can handle end of function symbols.  */
+       last_function_start = CUR_SYMBOL_VALUE;
+
        /* In reordered executables this function may lie outside
           the bounds created by N_SO symbols.  If that's the case
           use the address of this function as the low bound for
@@ -621,22 +621,27 @@ switch (CUR_SYMBOL_TYPE)
       case 'F':
        CUR_SYMBOL_VALUE += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
 #ifdef DBXREAD_ONLY
-       /* Keep track of the start of the last function so we
-          can handle end of function symbols.  */
-       last_function_start = CUR_SYMBOL_VALUE;
        /* Kludges for ELF/STABS with Sun ACC */
        last_function_name = namestring;
 #ifdef SOFUN_ADDRESS_MAYBE_MISSING
        /* Do not fix textlow==0 for .o or NLM files, as 0 is a legit
           value for the bottom of the text seg in those cases. */
+       if (CUR_SYMBOL_VALUE == ANOFFSET (objfile->section_offsets, 
+                                         SECT_OFF_TEXT))
+         CUR_SYMBOL_VALUE = 
+           find_stab_function_addr (namestring, pst->filename, objfile);
        if (pst && textlow_not_set)
          {
-           pst->textlow =
-             find_stab_function_addr (namestring, pst, objfile);
+           pst->textlow = CUR_SYMBOL_VALUE;
            textlow_not_set = 0;
          }
 #endif
        /* End kludge.  */
+
+       /* Keep track of the start of the last function so we
+          can handle end of function symbols.  */
+       last_function_start = CUR_SYMBOL_VALUE;
+
        /* In reordered executables this function may lie outside
           the bounds created by N_SO symbols.  If that's the case
           use the address of this function as the low bound for
This page took 0.025166 seconds and 4 git commands to generate.