diff options
author | Stephane Carrez <stcarrez@nerim.fr> | 2003-07-20 14:18:14 +0000 |
---|---|---|
committer | Stephane Carrez <stcarrez@nerim.fr> | 2003-07-20 14:18:14 +0000 |
commit | ef2b8fcdd80de265ba1c78995be2563f629c2e3c (patch) | |
tree | 537528925a6814160fcf95af4d2db5fe9c157659 /gdb | |
parent | 3ecf492f80abd3ec813cc6ed81b205ac3bae7c1a (diff) | |
download | gdb-ef2b8fcdd80de265ba1c78995be2563f629c2e3c.zip gdb-ef2b8fcdd80de265ba1c78995be2563f629c2e3c.tar.gz gdb-ef2b8fcdd80de265ba1c78995be2563f629c2e3c.tar.bz2 |
* m68hc11-tdep.c (m68hc11_extract_return_value): Use regcache_raw_read
and translate to use regcache.
(m68hc11_gdbarch_init): Undeprecate extract_return_value.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/m68hc11-tdep.c | 33 |
2 files changed, 24 insertions, 15 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 7d5eedb..f6482eb 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2003-07-20 Stephane Carrez <stcarrez@nerim.fr> + + * m68hc11-tdep.c (m68hc11_extract_return_value): Use regcache_raw_read + and translate to use regcache. + (m68hc11_gdbarch_init): Undeprecate extract_return_value. + 2003-07-18 Andrew Cagney <cagney@redhat.com> * gdbarch.sh (DWARF2_BUILD_FRAME_INFO): Delete method. diff --git a/gdb/m68hc11-tdep.c b/gdb/m68hc11-tdep.c index 99903ed..686fb40 100644 --- a/gdb/m68hc11-tdep.c +++ b/gdb/m68hc11-tdep.c @@ -1101,34 +1101,37 @@ m68hc11_store_return_value (struct type *type, char *valbuf) } -/* Given a return value in `regbuf' with a type `type', +/* Given a return value in `regcache' with a type `type', extract and copy its value into `valbuf'. */ static void -m68hc11_extract_return_value (struct type *type, - char *regbuf, - char *valbuf) +m68hc11_extract_return_value (struct type *type, struct regcache *regcache, + void *valbuf) { int len = TYPE_LENGTH (type); - + char buf[M68HC11_REG_SIZE]; + + regcache_raw_read (regcache, HARD_D_REGNUM, buf); switch (len) { case 1: - memcpy (valbuf, ®buf[HARD_D_REGNUM * 2 + 1], len); + memcpy (valbuf, buf + 1, 1); break; - + case 2: - memcpy (valbuf, ®buf[HARD_D_REGNUM * 2], len); + memcpy (valbuf, buf, 2); break; - + case 3: - memcpy (&valbuf[0], ®buf[HARD_X_REGNUM * 2 + 1], 1); - memcpy (&valbuf[1], ®buf[HARD_D_REGNUM * 2], 2); + memcpy ((char*) valbuf + 1, buf, 2); + regcache_raw_read (regcache, HARD_X_REGNUM, buf); + memcpy (valbuf, buf + 1, 1); break; - + case 4: - memcpy (&valbuf[0], ®buf[HARD_X_REGNUM * 2], 2); - memcpy (&valbuf[2], ®buf[HARD_D_REGNUM * 2], 2); + memcpy ((char*) valbuf + 2, buf, 2); + regcache_raw_read (regcache, HARD_X_REGNUM, buf); + memcpy (valbuf, buf, 2); break; default: @@ -1369,7 +1372,7 @@ m68hc11_gdbarch_init (struct gdbarch_info info, set_gdbarch_deprecated_call_dummy_words (gdbarch, m68hc11_call_dummy_words); set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, sizeof (m68hc11_call_dummy_words)); set_gdbarch_deprecated_get_saved_register (gdbarch, deprecated_generic_get_saved_register); - set_gdbarch_deprecated_extract_return_value (gdbarch, m68hc11_extract_return_value); + set_gdbarch_extract_return_value (gdbarch, m68hc11_extract_return_value); set_gdbarch_deprecated_push_arguments (gdbarch, m68hc11_push_arguments); set_gdbarch_deprecated_push_return_address (gdbarch, m68hc11_push_return_address); set_gdbarch_return_value_on_stack (gdbarch, m68hc11_return_value_on_stack); |