diff options
author | Jason Molenda <jmolenda@apple.com> | 2000-02-01 03:19:29 +0000 |
---|---|---|
committer | Jason Molenda <jmolenda@apple.com> | 2000-02-01 03:19:29 +0000 |
commit | da59e08184255e09e51e54bb356e4448d33b2245 (patch) | |
tree | 7b31845d077b659d43f8a6597270e121c75f77e4 /gdb/findvar.c | |
parent | 557537a5563f40d36fb91d03551da70f4b0faf34 (diff) | |
download | gdb-da59e08184255e09e51e54bb356e4448d33b2245.zip gdb-da59e08184255e09e51e54bb356e4448d33b2245.tar.gz gdb-da59e08184255e09e51e54bb356e4448d33b2245.tar.bz2 |
import gdb-2000-01-31 snapshot
Diffstat (limited to 'gdb/findvar.c')
-rw-r--r-- | gdb/findvar.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/gdb/findvar.c b/gdb/findvar.c index 163e9f7..4a5a3a0 100644 --- a/gdb/findvar.c +++ b/gdb/findvar.c @@ -1454,6 +1454,10 @@ value_from_register (type, regnum, frame) CHECK_TYPEDEF (type); len = TYPE_LENGTH (type); + /* Pointers on D10V are really only 16 bits, but we lie to gdb elsewhere... */ + if (GDB_TARGET_IS_D10V && TYPE_CODE (type) == TYPE_CODE_PTR) + len = 2; + VALUE_REGNO (v) = regnum; num_storage_locs = (len > REGISTER_VIRTUAL_SIZE (regnum) ? @@ -1652,6 +1656,29 @@ value_from_register (type, regnum, frame) memcpy (VALUE_CONTENTS_RAW (v), raw_buffer + VALUE_OFFSET (v), len); } + if (GDB_TARGET_IS_D10V + && TYPE_CODE (type) == TYPE_CODE_PTR + && TYPE_TARGET_TYPE (type) + && (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_FUNC)) + { + /* pointer to function */ + unsigned long num; + unsigned short snum; + snum = (unsigned short) extract_unsigned_integer (VALUE_CONTENTS_RAW (v), 2); + num = D10V_MAKE_IADDR (snum); + store_address (VALUE_CONTENTS_RAW (v), 4, num); + } + else if (GDB_TARGET_IS_D10V + && TYPE_CODE (type) == TYPE_CODE_PTR) + { + /* pointer to data */ + unsigned long num; + unsigned short snum; + snum = (unsigned short) extract_unsigned_integer (VALUE_CONTENTS_RAW (v), 2); + num = D10V_MAKE_DADDR (snum); + store_address (VALUE_CONTENTS_RAW (v), 4, num); + } + return v; } |