aboutsummaryrefslogtreecommitdiff
path: root/gdb/values.c
diff options
context:
space:
mode:
authorJim Kingdon <jkingdon@engr.sgi.com>1991-05-03 00:50:18 +0000
committerJim Kingdon <jkingdon@engr.sgi.com>1991-05-03 00:50:18 +0000
commit2bff8e38bcfa1cbc460bd605e6907bc99158a096 (patch)
tree7a30b45d4d7cf0652d4a585982df7fdeac6fcb6e /gdb/values.c
parent23b0b55855895b0654f2c7916f953b802398bb25 (diff)
downloadgdb-2bff8e38bcfa1cbc460bd605e6907bc99158a096.zip
gdb-2bff8e38bcfa1cbc460bd605e6907bc99158a096.tar.gz
gdb-2bff8e38bcfa1cbc460bd605e6907bc99158a096.tar.bz2
*** empty log message ***
Diffstat (limited to 'gdb/values.c')
-rw-r--r--gdb/values.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/gdb/values.c b/gdb/values.c
index 5f41e64..ba27f83 100644
--- a/gdb/values.c
+++ b/gdb/values.c
@@ -538,12 +538,9 @@ CORE_ADDR
value_as_pointer (val)
value val;
{
- /* This coerces arrays and functions, which is necessary (e.g.
- in disassemble_command). It also dereferences references, which
- I suspect is the most logical thing to do. */
- if (TYPE_CODE (VALUE_TYPE (val)) != TYPE_CODE_ENUM)
- COERCE_ARRAY (val);
- return unpack_pointer (VALUE_TYPE (val), VALUE_CONTENTS (val));
+ /* Assume a CORE_ADDR can fit in a LONGEST (for now). Not sure
+ whether we want this to be true eventually. */
+ return value_as_long (val);
}
/* Unpack raw data (copied from debugee, target byte order) at VALADDR
@@ -687,9 +684,8 @@ unpack_long (type, valaddr)
error ("That operation is not possible on an integer of that size.");
}
}
-#if 0
- /* There is no guarantee that a pointer can fit within a LONGEST.
- Callers should use unpack_pointer instead. */
+ /* Assume a CORE_ADDR can fit in a LONGEST (for now). Not sure
+ whether we want this to be true eventually. */
else if (code == TYPE_CODE_PTR
|| code == TYPE_CODE_REF)
{
@@ -701,15 +697,10 @@ unpack_long (type, valaddr)
return retval;
}
}
-#endif
else if (code == TYPE_CODE_MEMBER)
error ("not implemented: member types in unpack_long");
-#if 0
error ("Value not integer or pointer.");
-#else
- error ("Value not integer.");
-#endif
return 0; /* For lint -- never reached */
}
@@ -790,6 +781,9 @@ unpack_pointer (type, valaddr)
struct type *type;
char *valaddr;
{
+#if 0
+ /* The user should be able to use an int (e.g. 0x7892) in contexts
+ where a pointer is expected. So this doesn't do enough. */
register enum type_code code = TYPE_CODE (type);
register int len = TYPE_LENGTH (type);
@@ -810,6 +804,11 @@ unpack_pointer (type, valaddr)
error ("Value is not a pointer.");
return 0; /* For lint -- never reached */
+#else
+ /* Assume a CORE_ADDR can fit in a LONGEST (for now). Not sure
+ whether we want this to be true eventually. */
+ return unpack_long (type, valaddr);
+#endif
}
/* Given a value ARG1 (offset by OFFSET bytes)