]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* stabsread.c (define_symbol): If REG_STRUCT_HAS_ADDR, also
authorJim Kingdon <jkingdon@engr.sgi.com>
Thu, 10 Mar 1994 18:21:02 +0000 (18:21 +0000)
committerJim Kingdon <jkingdon@engr.sgi.com>
Thu, 10 Mar 1994 18:21:02 +0000 (18:21 +0000)
convert a LOC_ARG to a LOC_REF_ARG.  Update code which combines
'p' and 'r' symbol descriptors into a single symbol to look for a
LOC_REF_ARG.
* README, config/sparc/tm-sparc.h: Update comments.

gdb/config/sparc/tm-sparc.h
gdb/stabsread.c

index 69899b868c3110c89a1a519f4112c9b704408342..5fe91a8627f72c842053de1d9dc81337d713464b 100644 (file)
@@ -28,10 +28,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
    not the structure itself.  It (under SunOS4) creates two symbols,
    which we need to combine to a LOC_REGPARM.  Gcc version two (as of
    1.92) behaves like sun cc.  REG_STRUCT_HAS_ADDR is smart enough to
-   distinguish between Sun cc, gcc version 1 and gcc version 2.
+   distinguish between Sun cc, gcc version 1 and gcc version 2.  */
 
-   This still doesn't work if the argument is not one passed in a
-   register (i.e. it's the 7th or later argument).  */
 #define REG_STRUCT_HAS_ADDR(gcc_p) (gcc_p != 1)
 
 /* Sun /bin/cc gets this right as of SunOS 4.1.x.  We need to define
index 4a6ccdaecfbf107007c9f31c1d1392feefae7a47..ec88be171035a190daac88d664168a2d2748d4e3 100644 (file)
@@ -989,7 +989,7 @@ define_symbol (valu, string, desc, type, objfile)
            {
              struct symbol *prev_sym;
              prev_sym = local_symbols->symbol[local_symbols->nsyms - 1];
-             if (SYMBOL_CLASS (prev_sym) == LOC_ARG
+             if (SYMBOL_CLASS (prev_sym) == LOC_REF_ARG
                  && STREQ (SYMBOL_NAME (prev_sym), SYMBOL_NAME(sym)))
                {
                  SYMBOL_CLASS (prev_sym) = LOC_REGPARM;
@@ -1181,6 +1181,14 @@ define_symbol (valu, string, desc, type, objfile)
          || (TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_UNION)))
     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).  */
+  if (SYMBOL_CLASS (sym) == LOC_ARG
+      && REG_STRUCT_HAS_ADDR (processing_gcc_compilation)
+      && ((TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_STRUCT)
+         || (TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_UNION)))
+    SYMBOL_CLASS (sym) = LOC_REF_ARG;
+
   return sym;
 }