diff options
author | Andrew Cagney <cagney@redhat.com> | 2000-04-21 04:17:18 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2000-04-21 04:17:18 +0000 |
commit | 2ada493ad19d2c56b79df05931f7c82710259000 (patch) | |
tree | 80c8c32b690dc195bb691cb7c9f32fee53c51b52 /gdb/valops.c | |
parent | 2f9429aea399b8ff5c1d2d8f7dd0b5e14202f1e8 (diff) | |
download | gdb-2ada493ad19d2c56b79df05931f7c82710259000.zip gdb-2ada493ad19d2c56b79df05931f7c82710259000.tar.gz gdb-2ada493ad19d2c56b79df05931f7c82710259000.tar.bz2 |
* valops.c (hand_function_call): Replace #ifdef STACK_ALIGN with
run-time test for STACK_ALIGN_P.
* gdbarch.sh: Add support for function and variable predicates.
(STACK_ALIGN): Add. Implement with predicate - STACK_ALIGN_P.
* gdbarch.h, gdbarch.c: Re-generate.
Diffstat (limited to 'gdb/valops.c')
-rw-r--r-- | gdb/valops.c | 35 |
1 files changed, 15 insertions, 20 deletions
diff --git a/gdb/valops.c b/gdb/valops.c index 3198741..36846c7 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -1534,14 +1534,14 @@ You must use a pointer to function type variable. Command ignored.", arg_name); arg_type = check_typedef (VALUE_ENCLOSING_TYPE (args[i])); len = TYPE_LENGTH (arg_type); -#ifdef STACK_ALIGN - /* 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; -#endif + 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 */ @@ -1583,12 +1583,11 @@ You must use a pointer to function type variable. Command ignored.", arg_name); if (struct_return) { int len = TYPE_LENGTH (value_type); -#ifdef STACK_ALIGN - /* 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. */ - len = STACK_ALIGN (len); -#endif + 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. */ + len = STACK_ALIGN (len); if (INNER_THAN (1, 2)) { /* stack grows downward */ @@ -1609,11 +1608,10 @@ You must use a pointer to function type variable. Command ignored.", arg_name); hppa_push_arguments */ #ifndef NO_EXTRA_ALIGNMENT_NEEDED -#if defined(STACK_ALIGN) /* 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. */ - if (INNER_THAN (1, 2)) + if (STACK_ALIGN_P () && INNER_THAN (1, 2)) { /* If stack grows down, we must leave a hole at the top. */ int len = 0; @@ -1624,7 +1622,6 @@ You must use a pointer to function type variable. Command ignored.", arg_name); len += CALL_DUMMY_STACK_ADJUST; sp -= STACK_ALIGN (len) - len; } -#endif /* STACK_ALIGN */ #endif /* NO_EXTRA_ALIGNMENT_NEEDED */ sp = PUSH_ARGUMENTS (nargs, args, sp, struct_return, struct_addr); @@ -1642,8 +1639,7 @@ You must use a pointer to function type variable. Command ignored.", arg_name); sp = PUSH_RETURN_ADDRESS (real_pc, sp); #endif /* PUSH_RETURN_ADDRESS */ -#if defined(STACK_ALIGN) - if (!INNER_THAN (1, 2)) + if (STACK_ALIGN_P () && !INNER_THAN (1, 2)) { /* If stack grows up, we must leave a hole at the bottom, note that sp already has been advanced for the arguments! */ @@ -1651,7 +1647,6 @@ You must use a pointer to function type variable. Command ignored.", arg_name); sp += CALL_DUMMY_STACK_ADJUST; sp = STACK_ALIGN (sp); } -#endif /* STACK_ALIGN */ /* XXX This seems wrong. For stacks that grow down we shouldn't do anything here! */ |