mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-22 02:50:08 +08:00
* stabsread.c (define_symbol): If REG_STRUCT_HAS_ADDR is non-zero,
follow typedefs before checking TYPE_CODE for structures and unions.
This commit is contained in:
@ -1777,22 +1777,26 @@ define_symbol (valu, string, desc, type, objfile)
|
|||||||
/* When passing structures to a function, some systems sometimes pass
|
/* When passing structures to a function, some systems sometimes pass
|
||||||
the address in a register, not the structure itself. */
|
the address in a register, not the structure itself. */
|
||||||
|
|
||||||
if (REG_STRUCT_HAS_ADDR (processing_gcc_compilation,
|
if (REG_STRUCT_HAS_ADDR (processing_gcc_compilation, SYMBOL_TYPE (sym))
|
||||||
SYMBOL_TYPE (sym))
|
&& (SYMBOL_CLASS (sym) == LOC_REGPARM || SYMBOL_CLASS (sym) == LOC_ARG))
|
||||||
&& ((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 yields non-zero we have to
|
struct type *symbol_type = check_typedef (SYMBOL_TYPE (sym));
|
||||||
convert LOC_REGPARM to LOC_REGPARM_ADDR for structures and unions. */
|
|
||||||
|
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)
|
if (SYMBOL_CLASS (sym) == LOC_REGPARM)
|
||||||
SYMBOL_CLASS (sym) = LOC_REGPARM_ADDR;
|
SYMBOL_CLASS (sym) = LOC_REGPARM_ADDR;
|
||||||
/* Likewise for converting LOC_ARG to LOC_REF_ARG (for the 7th and
|
/* Likewise for converting LOC_ARG to LOC_REF_ARG (for the 7th
|
||||||
subsequent arguments on the sparc, for example). */
|
and subsequent arguments on the sparc, for example). */
|
||||||
else if (SYMBOL_CLASS (sym) == LOC_ARG)
|
else if (SYMBOL_CLASS (sym) == LOC_ARG)
|
||||||
SYMBOL_CLASS (sym) = LOC_REF_ARG;
|
SYMBOL_CLASS (sym) = LOC_REF_ARG;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return sym;
|
return sym;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user