aboutsummaryrefslogtreecommitdiff
path: root/gdb/rs6000-tdep.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2004-01-17 00:00:48 +0000
committerAndrew Cagney <cagney@redhat.com>2004-01-17 00:00:48 +0000
commit7aea86e6b121d5a8f4e531180f7ba548f876c252 (patch)
tree24ec3c6c4d312f3d10ee139cbc938db9c10ded38 /gdb/rs6000-tdep.c
parent593a5c7394ed22cfdf046429148727a51d5b1e74 (diff)
downloadgdb-7aea86e6b121d5a8f4e531180f7ba548f876c252.zip
gdb-7aea86e6b121d5a8f4e531180f7ba548f876c252.tar.gz
gdb-7aea86e6b121d5a8f4e531180f7ba548f876c252.tar.bz2
2004-01-16 Andrew Cagney <cagney@redhat.com>
Changes from Peter Schauer. * rs6000-tdep.c: Update copyright year. (rs6000_push_dummy_call): Update the stack pointer before accessing the corresponding stack region. * rs6000-nat.c: Update copyright year. (set_host_arch): Set "info.abfd" to "exec_bfd".
Diffstat (limited to 'gdb/rs6000-tdep.c')
-rw-r--r--gdb/rs6000-tdep.c31
1 files changed, 21 insertions, 10 deletions
diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
index 698e77a..a1edf5a 100644
--- a/gdb/rs6000-tdep.c
+++ b/gdb/rs6000-tdep.c
@@ -1,7 +1,8 @@
/* Target-dependent code for GDB, the GNU debugger.
- Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
- 1998, 1999, 2000, 2001, 2002, 2003
- Free Software Foundation, Inc.
+
+ Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996,
+ 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software
+ Foundation, Inc.
This file is part of GDB.
@@ -1247,6 +1248,14 @@ ran_out_of_registers_for_arguments:
space = (space + 15) & -16;
sp -= space;
+ /* This is another instance we need to be concerned about
+ securing our stack space. If we write anything underneath %sp
+ (r1), we might conflict with the kernel who thinks he is free
+ to use this area. So, update %sp first before doing anything
+ else. */
+
+ regcache_raw_write_signed (regcache, SP_REGNUM, sp);
+
/* If the last argument copied into the registers didn't fit there
completely, push the rest of it into stack. */
@@ -1288,16 +1297,18 @@ ran_out_of_registers_for_arguments:
}
}
- /* set back chain properly */
- store_unsigned_integer (tmp_buffer, 4, saved_sp);
- write_memory (sp, tmp_buffer, 4);
-
/* Set the stack pointer. According to the ABI, the SP is meant to
- be set _before_ the corresponding stack space is used. No need
- for that here though - the target has been completely stopped -
- it isn't possible for an exception handler to stomp on the stack. */
+ be set _before_ the corresponding stack space is used. On AIX,
+ this even applies when the target has been completely stopped!
+ Not doing this can lead to conflicts with the kernel which thinks
+ that it still has control over this not-yet-allocated stack
+ region. */
regcache_raw_write_signed (regcache, SP_REGNUM, sp);
+ /* Set back chain properly. */
+ store_unsigned_integer (tmp_buffer, 4, saved_sp);
+ write_memory (sp, tmp_buffer, 4);
+
/* Point the inferior function call's return address at the dummy's
breakpoint. */
regcache_raw_write_signed (regcache, tdep->ppc_lr_regnum, bp_addr);