diff options
author | Steve Chamberlain <sac@cygnus> | 1992-02-06 20:03:31 +0000 |
---|---|---|
committer | Steve Chamberlain <sac@cygnus> | 1992-02-06 20:03:31 +0000 |
commit | 1f46923ff419face15f7232a8c33efc5beecea15 (patch) | |
tree | 92292b563912f3e2b22b2964cfc51a99a5156f4b /gdb/values.c | |
parent | ab6c26bae16d9b02b20fb5e98dbae1d63f22e8e6 (diff) | |
download | gdb-1f46923ff419face15f7232a8c33efc5beecea15.zip gdb-1f46923ff419face15f7232a8c33efc5beecea15.tar.gz gdb-1f46923ff419face15f7232a8c33efc5beecea15.tar.bz2 |
* coffread.c (read_enum_type): Use the size of a target int when
describing enum.
* defs.h: added new #define for TARGET_PTR_BIT, defaults to size
of target int.
* h8300-tdep.c, remote-hms.c, tm-h8300.h: too many changes to count
* symtab.c (lookup_reference_type, lookup_ptr_type): use
TARGET_PTR_BIT to determine size of a pointer
* values.c (unpack_long): when unpacking a REF or a PTR don't
assume the size of the type.
Diffstat (limited to 'gdb/values.c')
-rw-r--r-- | gdb/values.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/gdb/values.c b/gdb/values.c index 2c8143d..e3c3187 100644 --- a/gdb/values.c +++ b/gdb/values.c @@ -690,13 +690,20 @@ unpack_long (type, valaddr) else if (code == TYPE_CODE_PTR || code == TYPE_CODE_REF) { - if (len == sizeof (CORE_ADDR)) - { - CORE_ADDR retval; - bcopy (valaddr, &retval, sizeof (retval)); - SWAP_TARGET_AND_HOST (&retval, sizeof (retval)); - return retval; - } + if (len == sizeof(long)) + { + long retval; + bcopy (valaddr, &retval, sizeof(retval)); + SWAP_TARGET_AND_HOST (&retval, sizeof(retval)); + return retval; + } + else if (len == sizeof(short)) + { + short retval; + bcopy (valaddr, &retval, len); + SWAP_TARGET_AND_HOST (&retval, len); + return retval; + } } else if (code == TYPE_CODE_MEMBER) error ("not implemented: member types in unpack_long"); |