* strerror.c: Revert last change. Declare static sys_nerr
[deliverable/binutils-gdb.git] / gdb / stabsread.c
index abfbefc6f747388d3f97e959a961db5f48d518cb..bb89edb65b14c0832917a2edbbcab6c61e0acf67 100644 (file)
@@ -1211,7 +1211,6 @@ symbol_reference_defined (char **string)
     }
 }
 
-/* ARGSUSED */
 struct symbol *
 define_symbol (CORE_ADDR valu, char *string, int desc, int type,
               struct objfile *objfile)
@@ -1748,17 +1747,20 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
       SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
       if (within_function)
        {
-         /* Sun cc uses a pair of symbols, one 'p' and one 'r' with the same
-            name to represent an argument passed in a register.
-            GCC uses 'P' for the same case.  So if we find such a symbol pair
-            we combine it into one 'P' symbol.  For Sun cc we need to do this
-            regardless of DEPRECATED_REG_STRUCT_HAS_ADDR, because the compiler puts out
-            the 'p' symbol even if it never saves the argument onto the stack.
-
-            On most machines, we want to preserve both symbols, so that
-            we can still get information about what is going on with the
-            stack (VAX for computing args_printed, using stack slots instead
-            of saved registers in backtraces, etc.).
+         /* Sun cc uses a pair of symbols, one 'p' and one 'r', with
+            the same name to represent an argument passed in a
+            register.  GCC uses 'P' for the same case.  So if we find
+            such a symbol pair we combine it into one 'P' symbol.
+            For Sun cc we need to do this regardless of
+            stabs_argument_has_addr, because the compiler puts out
+            the 'p' symbol even if it never saves the argument onto
+            the stack.
+
+            On most machines, we want to preserve both symbols, so
+            that we can still get information about what is going on
+            with the stack (VAX for computing args_printed, using
+            stack slots instead of saved registers in backtraces,
+            etc.).
 
             Note that this code illegally combines
             main(argc) struct foo argc; { register struct foo argc; }
@@ -1768,13 +1770,8 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
          if (local_symbols
              && local_symbols->nsyms > 0
 #ifndef USE_REGISTER_NOT_ARG
-             && DEPRECATED_REG_STRUCT_HAS_ADDR_P ()
-             && DEPRECATED_REG_STRUCT_HAS_ADDR (processing_gcc_compilation,
-                                     SYMBOL_TYPE (sym))
-             && (TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_STRUCT
-                 || TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_UNION
-                 || TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_SET
-                 || TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_BITSTRING)
+             && gdbarch_stabs_argument_has_addr (current_gdbarch,
+                                                 SYMBOL_TYPE (sym))
 #endif
            )
            {
@@ -2047,29 +2044,21 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
       break;
     }
 
-  /* When passing structures to a function, some systems sometimes pass
-     the address in a register, not the structure itself. */
+  /* Some systems pass variables of certain types by reference instead
+     of by value, i.e. they will pass the address of a structure (in a
+     register or on the stack) instead of the structure itself.  */
 
-  if (DEPRECATED_REG_STRUCT_HAS_ADDR_P ()
-      && DEPRECATED_REG_STRUCT_HAS_ADDR (processing_gcc_compilation, SYMBOL_TYPE (sym))
+  if (gdbarch_stabs_argument_has_addr (current_gdbarch, SYMBOL_TYPE (sym))
       && (SYMBOL_CLASS (sym) == LOC_REGPARM || SYMBOL_CLASS (sym) == LOC_ARG))
     {
-      struct type *symbol_type = check_typedef (SYMBOL_TYPE (sym));
-
-      if ((TYPE_CODE (symbol_type) == TYPE_CODE_STRUCT)
-         || (TYPE_CODE (symbol_type) == TYPE_CODE_UNION)
-         || (TYPE_CODE (symbol_type) == TYPE_CODE_BITSTRING)
-         || (TYPE_CODE (symbol_type) == TYPE_CODE_SET))
-       {
-         /* If DEPRECATED_REG_STRUCT_HAS_ADDR yields non-zero we have to convert
-            LOC_REGPARM to LOC_REGPARM_ADDR for structures and unions. */
-         if (SYMBOL_CLASS (sym) == LOC_REGPARM)
-           SYMBOL_CLASS (sym) = LOC_REGPARM_ADDR;
-         /* Likewise for converting LOC_ARG to LOC_REF_ARG (for the 7th
-            and subsequent arguments on the sparc, for example).  */
-         else if (SYMBOL_CLASS (sym) == LOC_ARG)
-           SYMBOL_CLASS (sym) = LOC_REF_ARG;
-       }
+      /* We have to convert LOC_REGPARM to LOC_REGPARM_ADDR (for
+         variables passed in a register).  */
+      if (SYMBOL_CLASS (sym) == LOC_REGPARM)
+       SYMBOL_CLASS (sym) = LOC_REGPARM_ADDR;
+      /* Likewise for converting LOC_ARG to LOC_REF_ARG (for the 7th
+        and subsequent arguments on SPARC, for example).  */
+      else if (SYMBOL_CLASS (sym) == LOC_ARG)
+       SYMBOL_CLASS (sym) = LOC_REF_ARG;
     }
 
   /* Is there more to parse?  For example LRS/alias information?  */
This page took 0.024586 seconds and 4 git commands to generate.