aboutsummaryrefslogtreecommitdiff
path: root/gdb/stabsread.c
diff options
context:
space:
mode:
authorPeter Schauer <Peter.Schauer@mytum.de>1996-10-13 18:40:26 +0000
committerPeter Schauer <Peter.Schauer@mytum.de>1996-10-13 18:40:26 +0000
commit19406903ab6849e34361a3a0c2aabbf46cd029fc (patch)
tree79339003668d2bad4926f33fbfe77543bf3889e8 /gdb/stabsread.c
parent8918b3a72bdf6612978ab507298b53d6e87374ee (diff)
downloadgdb-19406903ab6849e34361a3a0c2aabbf46cd029fc.zip
gdb-19406903ab6849e34361a3a0c2aabbf46cd029fc.tar.gz
gdb-19406903ab6849e34361a3a0c2aabbf46cd029fc.tar.bz2
* stabsread.c (define_symbol): If REG_STRUCT_HAS_ADDR is non-zero,
follow typedefs before checking TYPE_CODE for structures and unions.
Diffstat (limited to 'gdb/stabsread.c')
-rw-r--r--gdb/stabsread.c32
1 files changed, 18 insertions, 14 deletions
diff --git a/gdb/stabsread.c b/gdb/stabsread.c
index adc0a36..be312af 100644
--- a/gdb/stabsread.c
+++ b/gdb/stabsread.c
@@ -1777,21 +1777,25 @@ define_symbol (valu, string, desc, type, objfile)
/* When passing structures to a function, some systems sometimes pass
the address in a register, not the structure itself. */
- if (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_BITSTRING)
- || (TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_SET)))
+ if (REG_STRUCT_HAS_ADDR (processing_gcc_compilation, SYMBOL_TYPE (sym))
+ && (SYMBOL_CLASS (sym) == LOC_REGPARM || SYMBOL_CLASS (sym) == LOC_ARG))
{
- /* If 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;
+ 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 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;
+ }
}
return sym;