* gdb.texinfo (Continuing and Stepping): When talking about "step"
[deliverable/binutils-gdb.git] / gdb / dbxread.c
index 56866185a2e2f18cf86c036e71930f669133fb47..b2bcb32ea621cabce9dad0e421b995ea1dddf375 100644 (file)
@@ -108,25 +108,6 @@ struct symloc {
 #define IGNORE_SYMBOL(type)  (type == (int)N_NSYMS)
 #endif
 
-/* Macro for name of symbol to indicate a file compiled with gcc. */
-#ifndef GCC_COMPILED_FLAG_SYMBOL
-#define GCC_COMPILED_FLAG_SYMBOL "gcc_compiled."
-#endif
-
-/* Macro for name of symbol to indicate a file compiled with gcc2. */
-#ifndef GCC2_COMPILED_FLAG_SYMBOL
-#define GCC2_COMPILED_FLAG_SYMBOL "gcc2_compiled."
-#endif
-
-/* Define this as 1 if a pcc declaration of a char or short argument
-   gives the correct address.  Otherwise assume pcc gives the
-   address of the corresponding int, which is not the same on a
-   big-endian machine.  */
-
-#ifndef BELIEVE_PCC_PROMOTION
-#define BELIEVE_PCC_PROMOTION 0
-#endif
-
 /* Remember what we deduced to be the source language of this psymtab. */
 
 static enum language psymtab_language = language_unknown;
@@ -436,24 +417,6 @@ record_minimal_symbol (name, address, type, objfile)
       break;
 #endif
     case N_TEXT:
-      /* Don't put gcc_compiled, __gnu_compiled_cplus, and friends into
-        the minimal symbols, because if there is also another symbol
-        at the same address (e.g. the first function of the file),
-        lookup_minimal_symbol_by_pc would have no way of getting the
-        right one.  */
-      if (name[0] == 'g'
-         && (strcmp (name, GCC_COMPILED_FLAG_SYMBOL) == 0
-             || strcmp (name, GCC2_COMPILED_FLAG_SYMBOL) == 0))
-       return;
-
-      {
-       char *tempstring = name;
-       if (tempstring[0] == bfd_get_symbol_leading_char (objfile->obfd))
-         ++tempstring;
-       if (STREQN (tempstring, "__gnu_compiled", 14))
-         return;
-      }
-
     case N_NBTEXT:
     case N_FN:
     case N_FN_SEQ:
@@ -490,7 +453,8 @@ record_minimal_symbol (name, address, type, objfile)
   prim_record_minimal_symbol
     (obsavestring (name, strlen (name), &objfile -> symbol_obstack),
      address,
-     ms_type);
+     ms_type,
+     objfile);
 }
 \f
 /* Scan and build partial symbols for a symbol file.
@@ -1071,6 +1035,7 @@ end_psymtab (pst, include_list, num_includes, capping_symbol_offset,
       LDSYMLEN(pst) = capping_symbol_offset - LDSYMOFF(pst);
   pst->texthigh = capping_text;
 
+#ifdef N_SO_ADDRESS_MAYBE_MISSING
   /* Under Solaris, the N_SO symbols always have a value of 0,
      instead of the usual address of the .o file.  Therefore,
      we have to do some tricks to fill in texthigh and textlow.
@@ -1137,6 +1102,9 @@ end_psymtab (pst, include_list, num_includes, capping_symbol_offset,
 
   /* this test will be true if the last .o file is only data */
   if (pst->textlow == 0)
+    /* This loses if the text section really starts at address zero
+       (generally true when we are debugging a .o file, for example).
+       That is why this whole thing is inside N_SO_ADDRESS_MIGHT_LIE.  */
     pst->textlow = pst->texthigh;
 
   /* If we know our own starting text address, then walk through all other
@@ -1156,7 +1124,7 @@ end_psymtab (pst, include_list, num_includes, capping_symbol_offset,
   }
 
   /* End of kludge for patching Solaris textlow and texthigh.  */
-
+#endif /* NO_SO_ADDRESS_MAYBE_MISSING.  */
 
   pst->n_global_syms =
     objfile->global_psymbols.next - (objfile->global_psymbols.list + pst->globals_offset);
@@ -1554,7 +1522,8 @@ process_one_symbol (type, desc, valu, name, section_offsets, objfile)
      since it would be silly to do things differently from Solaris), and
      false for SunOS4 and other a.out file formats.  */
   block_address_function_relative =
-    0 == strncmp (bfd_get_target (objfile->obfd), "elf", 3);
+    (0 == strncmp (bfd_get_target (objfile->obfd), "elf", 3))
+     || (0 == strncmp (bfd_get_target (objfile->obfd), "som", 3));
 
   if (!block_address_function_relative)
     /* N_LBRAC, N_RBRAC and N_SLINE entries are not relative to the
@@ -1643,33 +1612,38 @@ process_one_symbol (type, desc, valu, name, section_offsets, objfile)
       if (!VARIABLES_INSIDE_BLOCK(desc, processing_gcc_compilation))
        local_symbols = new->locals;
 
-      /* If this is not the outermost LBRAC...RBRAC pair in the
-        function, its local symbols preceded it, and are the ones
-        just recovered from the context stack.  Defined the block for them.
-
-        If this is the outermost LBRAC...RBRAC pair, there is no
-        need to do anything; leave the symbols that preceded it
-        to be attached to the function's own block.  However, if
-        it is so, we need to indicate that we just moved outside
-        of the function.  */
-      if (local_symbols
-         && (context_stack_depth
-             > !VARIABLES_INSIDE_BLOCK(desc, processing_gcc_compilation)))
+      if (context_stack_depth
+         > !VARIABLES_INSIDE_BLOCK(desc, processing_gcc_compilation))
        {
-         /* FIXME Muzzle a compiler bug that makes end < start.  */
-         if (new->start_addr > valu)
+         /* This is not the outermost LBRAC...RBRAC pair in the function,
+            its local symbols preceded it, and are the ones just recovered
+            from the context stack.  Define the block for them (but don't
+            bother if the block contains no symbols.  Should we complain
+            on blocks without symbols?  I can't think of any useful purpose
+            for them).  */
+         if (local_symbols != NULL)
            {
-             complain (&lbrac_rbrac_complaint);
-             new->start_addr = valu;
+             /* Muzzle a compiler bug that makes end < start.  (which
+                compilers?  Is this ever harmful?).  */
+             if (new->start_addr > valu)
+               {
+                 complain (&lbrac_rbrac_complaint);
+                 new->start_addr = valu;
+               }
+             /* Make a block for the local symbols within.  */
+             finish_block (0, &local_symbols, new->old_blocks,
+                           new->start_addr, valu, objfile);
            }
-         /* Make a block for the local symbols within.  */
-         finish_block (0, &local_symbols, new->old_blocks,
-                       new->start_addr, valu, objfile);
        }
       else
        {
+         /* This is the outermost LBRAC...RBRAC pair.  There is no
+            need to do anything; leave the symbols that preceded it
+            to be attached to the function's own block.  We need to
+            indicate that we just moved outside of the function.  */
          within_function = 0;
        }
+
       if (VARIABLES_INSIDE_BLOCK(desc, processing_gcc_compilation))
        /* Now pop locals of block just finished.  */
        local_symbols = new->locals;
@@ -2166,6 +2140,9 @@ pastab_build_psymtabs (objfile, section_offsets, mainline)
   free_header_files ();
   init_header_files ();
 
+  /* This is needed to debug objects assembled with gas2.  */
+  processing_acc_compilation = 1;
+
   /* In a PA file, we've already installed the minimal symbols that came
      from the PA (non-stab) symbol table, so always act like an
      incremental load here. */
This page took 0.025021 seconds and 4 git commands to generate.