This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[PATCH] mips_extract_struct_return_value: use saved regcache
- From: Michael Snyder <msnyder at cygnus dot com>
- To: gdb-patches at sources dot redhat dot com
- Cc: cagney at redhat dot com
- Date: Thu, 5 Sep 2002 11:30:49 -0700
- Subject: [PATCH] mips_extract_struct_return_value: use saved regcache
(obvious)
2002-09-05 Michael Snyder <msnyder@redhat.com>
* mips-tdep.c (mips_extract_struct_value_address): Retrieve
V0_REGNUM from saved regcache, not from current regcache.
Index: mips-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/mips-tdep.c,v
retrieving revision 1.119
diff -p -r1.119 mips-tdep.c
*** mips-tdep.c 24 Aug 2002 00:21:35 -0000 1.119
--- mips-tdep.c 5 Sep 2002 18:27:42 -0000
*************** mips_store_struct_return (CORE_ADDR addr
*** 4906,4917 ****
}
static CORE_ADDR
! mips_extract_struct_value_address (struct regcache *ignore)
{
/* FIXME: This will only work at random. The caller passes the
struct_return address in V0, but it is not preserved. It may
still be there, or this may be a random value. */
! return read_register (V0_REGNUM);
}
/* Exported procedure: Is PC in the signal trampoline code */
--- 4902,4915 ----
}
static CORE_ADDR
! mips_extract_struct_value_address (struct regcache *regcache)
{
/* FIXME: This will only work at random. The caller passes the
struct_return address in V0, but it is not preserved. It may
still be there, or this may be a random value. */
! CORE_ADDR val;
! regcache_cooked_read_unsigned (regcache, V0_REGNUM, &val);
! return val;
}
/* Exported procedure: Is PC in the signal trampoline code */