diff options
author | Andrew Cagney <cagney@redhat.com> | 2000-04-22 06:44:39 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2000-04-22 06:44:39 +0000 |
commit | d03e67c95f6ddaaf4d8ad1a17752099403b83bda (patch) | |
tree | 63b8e978c16bb3925fc80a7ebf07a88c76406eaa /gdb/valops.c | |
parent | 19be430370b901be8149b925820d300a2663ef43 (diff) | |
download | binutils-gdb-d03e67c95f6ddaaf4d8ad1a17752099403b83bda.tar.gz |
Convert REG_STRUCT_HAS_ADDR to multi-arch. Use REG_STRUCT_HAS_ADDR_P
in conversion.
Diffstat (limited to 'gdb/valops.c')
-rw-r--r-- | gdb/valops.c | 132 |
1 files changed, 66 insertions, 66 deletions
diff --git a/gdb/valops.c b/gdb/valops.c index 36846c7ebdb..0632ede8208 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -1510,72 +1510,72 @@ You must use a pointer to function type variable. Command ignored.", arg_name); } } -#if defined (REG_STRUCT_HAS_ADDR) - { - /* This is a machine like the sparc, where we may need to pass a pointer - to the structure, not the structure itself. */ - for (i = nargs - 1; i >= 0; i--) - { - struct type *arg_type = check_typedef (VALUE_TYPE (args[i])); - if ((TYPE_CODE (arg_type) == TYPE_CODE_STRUCT - || TYPE_CODE (arg_type) == TYPE_CODE_UNION - || TYPE_CODE (arg_type) == TYPE_CODE_ARRAY - || TYPE_CODE (arg_type) == TYPE_CODE_STRING - || TYPE_CODE (arg_type) == TYPE_CODE_BITSTRING - || TYPE_CODE (arg_type) == TYPE_CODE_SET - || (TYPE_CODE (arg_type) == TYPE_CODE_FLT - && TYPE_LENGTH (arg_type) > 8) - ) - && REG_STRUCT_HAS_ADDR (using_gcc, arg_type)) - { - CORE_ADDR addr; - int len; /* = TYPE_LENGTH (arg_type); */ - int aligned_len; - arg_type = check_typedef (VALUE_ENCLOSING_TYPE (args[i])); - len = TYPE_LENGTH (arg_type); - - if (STACK_ALIGN_P ()) - /* MVS 11/22/96: I think at least some of this - stack_align code is really broken. Better to let - PUSH_ARGUMENTS adjust the stack in a target-defined - manner. */ - aligned_len = STACK_ALIGN (len); - else - aligned_len = len; - if (INNER_THAN (1, 2)) - { - /* stack grows downward */ - sp -= aligned_len; - } - else - { - /* The stack grows up, so the address of the thing we push - is the stack pointer before we push it. */ - addr = sp; - } - /* Push the structure. */ - write_memory (sp, VALUE_CONTENTS_ALL (args[i]), len); - if (INNER_THAN (1, 2)) - { - /* The stack grows down, so the address of the thing we push - is the stack pointer after we push it. */ - addr = sp; - } - else - { - /* stack grows upward */ - sp += aligned_len; - } - /* The value we're going to pass is the address of the thing - we just pushed. */ - /*args[i] = value_from_longest (lookup_pointer_type (value_type), - (LONGEST) addr); */ - args[i] = value_from_pointer (lookup_pointer_type (arg_type), - addr); - } - } - } -#endif /* REG_STRUCT_HAS_ADDR. */ + if (REG_STRUCT_HAS_ADDR_P ()) + { + /* This is a machine like the sparc, where we may need to pass a + pointer to the structure, not the structure itself. */ + for (i = nargs - 1; i >= 0; i--) + { + struct type *arg_type = check_typedef (VALUE_TYPE (args[i])); + if ((TYPE_CODE (arg_type) == TYPE_CODE_STRUCT + || TYPE_CODE (arg_type) == TYPE_CODE_UNION + || TYPE_CODE (arg_type) == TYPE_CODE_ARRAY + || TYPE_CODE (arg_type) == TYPE_CODE_STRING + || TYPE_CODE (arg_type) == TYPE_CODE_BITSTRING + || TYPE_CODE (arg_type) == TYPE_CODE_SET + || (TYPE_CODE (arg_type) == TYPE_CODE_FLT + && TYPE_LENGTH (arg_type) > 8) + ) + && REG_STRUCT_HAS_ADDR (using_gcc, arg_type)) + { + CORE_ADDR addr; + int len; /* = TYPE_LENGTH (arg_type); */ + int aligned_len; + arg_type = check_typedef (VALUE_ENCLOSING_TYPE (args[i])); + len = TYPE_LENGTH (arg_type); + + if (STACK_ALIGN_P ()) + /* MVS 11/22/96: I think at least some of this + stack_align code is really broken. Better to let + PUSH_ARGUMENTS adjust the stack in a target-defined + manner. */ + aligned_len = STACK_ALIGN (len); + else + aligned_len = len; + if (INNER_THAN (1, 2)) + { + /* stack grows downward */ + sp -= aligned_len; + } + else + { + /* The stack grows up, so the address of the thing + we push is the stack pointer before we push it. */ + addr = sp; + } + /* Push the structure. */ + write_memory (sp, VALUE_CONTENTS_ALL (args[i]), len); + if (INNER_THAN (1, 2)) + { + /* The stack grows down, so the address of the thing + we push is the stack pointer after we push it. */ + addr = sp; + } + else + { + /* stack grows upward */ + sp += aligned_len; + } + /* The value we're going to pass is the address of the + thing we just pushed. */ + /*args[i] = value_from_longest (lookup_pointer_type (value_type), + (LONGEST) addr); */ + args[i] = value_from_pointer (lookup_pointer_type (arg_type), + addr); + } + } + } + /* Reserve space for the return structure to be written on the stack, if necessary */ |