summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2001-10-16 01:58:07 +0000
committerAndrew Cagney <cagney@redhat.com>2001-10-16 01:58:07 +0000
commit4ebc0d353aac952ae3cce8620421ba232d228a92 (patch)
tree9be17841bba36e462b29b94eebe8037d6f43d2e5
parent7e604dd8c0ebf54ab545f229c2c2c1a786e9e51d (diff)
downloadgdb-4ebc0d353aac952ae3cce8620421ba232d228a92.tar.gz
* value.h (value_as_address): Rename value_as_pointer.
* eval.c, findvar.c, gnu-v2-abi.c, gnu-v3-abi.c, jv-lang.c, jv-valprint.c, printcmd.c, stack.c, top.c, valarith.c, valops.c, values.c: Update.
-rw-r--r--gdb/ChangeLog7
-rw-r--r--gdb/doc/ChangeLog5
-rw-r--r--gdb/doc/gdbint.texinfo4
-rw-r--r--gdb/eval.c6
-rw-r--r--gdb/findvar.c8
-rw-r--r--gdb/gnu-v2-abi.c4
-rw-r--r--gdb/gnu-v3-abi.c4
-rw-r--r--gdb/jv-lang.c6
-rw-r--r--gdb/jv-valprint.c8
-rw-r--r--gdb/printcmd.c6
-rw-r--r--gdb/stack.c4
-rw-r--r--gdb/top.c2
-rw-r--r--gdb/valarith.c14
-rw-r--r--gdb/valops.c6
-rw-r--r--gdb/value.h2
-rw-r--r--gdb/values.c6
16 files changed, 52 insertions, 40 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 9eff17cf17f..643a2a403ed 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,10 @@
+2001-10-15 Andrew Cagney <ac131313@redhat.com>
+
+ * value.h (value_as_address): Rename value_as_pointer.
+ * eval.c, findvar.c, gnu-v2-abi.c, gnu-v3-abi.c, jv-lang.c,
+ jv-valprint.c, printcmd.c, stack.c, top.c, valarith.c, valops.c,
+ values.c: Update.
+
202001-10-15 Jim Ingham <jingham@inghji.apple.com>
* valarith.c (value_sub): Don't pass a raw type to
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog
index 9466bd210b3..86ea9664fa7 100644
--- a/gdb/doc/ChangeLog
+++ b/gdb/doc/ChangeLog
@@ -1,5 +1,10 @@
2001-10-15 Andrew Cagney <ac131313@redhat.com>
+ * gdbint.texinfo (Target Architecture Definition): Function
+ value_as_pointer renamed to value_as_address.
+
+2001-10-15 Andrew Cagney <ac131313@redhat.com>
+
* gdbint.texinfo (Target Architecture Definition): Default
POINTER_TO_ADDRESS functions assume unsigned addresses.
(INTEGER_TO_ADDRESS): Document. Derive pragmatics section from a
diff --git a/gdb/doc/gdbint.texinfo b/gdb/doc/gdbint.texinfo
index 2c5e397a4cd..ca9fe4b6cb2 100644
--- a/gdb/doc/gdbint.texinfo
+++ b/gdb/doc/gdbint.texinfo
@@ -42,7 +42,7 @@ Software Foundation raise funds for GNU development.''
@page
@tex
\def\$#1${{#1}} % Kluge: collect RCS revision info without $...$
-\xdef\manvers{\$Revision: 1.40 $} % For use in headers, footers too
+\xdef\manvers{\$Revision: 1.41 $} % For use in headers, footers too
{\parskip=0pt
\hfill Cygnus Solutions\par
\hfill \manvers\par
@@ -2441,7 +2441,7 @@ If @var{type} is not a pointer or reference type, then this function
will signal an internal error.
@end deftypefun
-@deftypefun CORE_ADDR value_as_pointer (value_ptr @var{val})
+@deftypefun CORE_ADDR value_as_address (value_ptr @var{val})
Assuming that @var{val} is a pointer, return the address it represents,
as appropriate for the current architecture.
diff --git a/gdb/eval.c b/gdb/eval.c
index fad995ee35c..5638d2c15d6 100644
--- a/gdb/eval.c
+++ b/gdb/eval.c
@@ -80,7 +80,7 @@ parse_and_eval_address (char *exp)
register struct cleanup *old_chain =
make_cleanup (free_current_contents, &expr);
- addr = value_as_pointer (evaluate_expression (expr));
+ addr = value_as_address (evaluate_expression (expr));
do_cleanups (old_chain);
return addr;
}
@@ -96,7 +96,7 @@ parse_and_eval_address_1 (char **expptr)
register struct cleanup *old_chain =
make_cleanup (free_current_contents, &expr);
- addr = value_as_pointer (evaluate_expression (expr));
+ addr = value_as_address (evaluate_expression (expr));
do_cleanups (old_chain);
return addr;
}
@@ -1676,7 +1676,7 @@ evaluate_subexp_standard (struct type *expect_type,
return value_zero (exp->elts[pc + 1].type, lval_memory);
else
return value_at_lazy (exp->elts[pc + 1].type,
- value_as_pointer (arg1),
+ value_as_address (arg1),
NULL);
case UNOP_PREINCREMENT:
diff --git a/gdb/findvar.c b/gdb/findvar.c
index 04456207c7d..43e4b60a796 100644
--- a/gdb/findvar.c
+++ b/gdb/findvar.c
@@ -484,7 +484,7 @@ addresses have not been bound by the dynamic loader. Try again when executable i
locaddr = SYMBOL_VALUE_ADDRESS (var);
loc = value_at (lookup_pointer_type (type), locaddr, NULL);
- addr = value_as_pointer (loc);
+ addr = value_as_address (loc);
}
case LOC_ARG:
@@ -507,7 +507,7 @@ addresses have not been bound by the dynamic loader. Try again when executable i
return 0;
argref += SYMBOL_VALUE (var);
ref = value_at (lookup_pointer_type (type), argref, NULL);
- addr = value_as_pointer (ref);
+ addr = value_as_address (ref);
break;
}
@@ -529,7 +529,7 @@ addresses have not been bound by the dynamic loader. Try again when executable i
SYMBOL_BASEREG (var), frame);
if (regval == NULL)
error ("Value of base register not available.");
- addr = value_as_pointer (regval);
+ addr = value_as_address (regval);
addr += SYMBOL_VALUE (var);
break;
}
@@ -567,7 +567,7 @@ addresses have not been bound by the dynamic loader. Try again when executable i
if (regval == NULL)
error ("Value of register variable not available.");
- addr = value_as_pointer (regval);
+ addr = value_as_address (regval);
VALUE_LVAL (v) = lval_memory;
}
else
diff --git a/gdb/gnu-v2-abi.c b/gdb/gnu-v2-abi.c
index 8c46219971e..3b7715230f0 100644
--- a/gdb/gnu-v2-abi.c
+++ b/gdb/gnu-v2-abi.c
@@ -251,12 +251,12 @@ gnuv2_value_rtti_type (value_ptr v, int *full, int *top, int *using_enc)
TYPE_VPTR_FIELDNO (known_type));
tempval=value_field (v, TYPE_VPTR_FIELDNO(known_type));
VALUE_ADDRESS(tempval) += bitpos / 8;
- vtbl=value_as_pointer (tempval);
+ vtbl=value_as_address (tempval);
using_enclosing=1;
}
else
{
- vtbl=value_as_pointer(value_field(v,TYPE_VPTR_FIELDNO(known_type)));
+ vtbl=value_as_address(value_field(v,TYPE_VPTR_FIELDNO(known_type)));
using_enclosing=0;
}
diff --git a/gdb/gnu-v3-abi.c b/gdb/gnu-v3-abi.c
index d9da17c8b90..bffdca56b95 100644
--- a/gdb/gnu-v3-abi.c
+++ b/gdb/gnu-v3-abi.c
@@ -209,7 +209,7 @@ gnuv3_rtti_type (struct value *value,
/* Fetch VALUE's virtual table pointer, and tweak it to point at
an instance of our imaginary gdb_gnu_v3_abi_vtable structure. */
vtable_address
- = value_as_pointer (value_field (value, TYPE_VPTR_FIELDNO (value_type)));
+ = value_as_address (value_field (value, TYPE_VPTR_FIELDNO (value_type)));
vtable = value_at_lazy (vtable_type,
vtable_address - vtable_address_point_offset (),
VALUE_BFD_SECTION (value));
@@ -311,7 +311,7 @@ gnuv3_virtual_fn_field (struct value **value_p,
/* Now value is an object of the appropriate base type. Fetch its
virtual table. */
vtable_address
- = value_as_pointer (value_field (value, TYPE_VPTR_FIELDNO (vfn_base)));
+ = value_as_address (value_field (value, TYPE_VPTR_FIELDNO (vfn_base)));
vtable = value_at_lazy (vtable_type,
vtable_address - vtable_address_point_offset (),
VALUE_BFD_SECTION (value));
diff --git a/gdb/jv-lang.c b/gdb/jv-lang.c
index abd0470b7d3..a0d78d7d07b 100644
--- a/gdb/jv-lang.c
+++ b/gdb/jv-lang.c
@@ -232,7 +232,7 @@ java_class_from_object (value_ptr obj_val)
if (TYPE_CODE (VALUE_TYPE (obj_val)) == TYPE_CODE_PTR
&& TYPE_LENGTH (TYPE_TARGET_TYPE (VALUE_TYPE (obj_val))) == 0)
obj_val = value_at (get_java_object_type (),
- value_as_pointer (obj_val), NULL);
+ value_as_address (obj_val), NULL);
vtable_val = value_struct_elt (&obj_val, NULL, "vtable", NULL, "structure");
return value_struct_elt (&vtable_val, NULL, "class", NULL, "structure");
@@ -243,7 +243,7 @@ static int
java_class_is_primitive (value_ptr clas)
{
value_ptr vtable = value_struct_elt (&clas, NULL, "vtable", NULL, "struct");
- CORE_ADDR i = value_as_pointer (vtable);
+ CORE_ADDR i = value_as_address (vtable);
return (int) (i & 0x7fffffff) == (int) 0x7fffffff;
}
@@ -911,7 +911,7 @@ evaluate_subexp_java (struct type *expect_type, register struct expression *exp,
if (noside == EVAL_AVOID_SIDE_EFFECTS)
return value_zero (el_type, VALUE_LVAL (arg1));
- address = value_as_pointer (arg1);
+ address = value_as_address (arg1);
address += JAVA_OBJECT_SIZE;
read_memory (address, buf4, 4);
length = (long) extract_signed_integer (buf4, 4);
diff --git a/gdb/jv-valprint.c b/gdb/jv-valprint.c
index 9ba953ee66a..ad059bec262 100644
--- a/gdb/jv-valprint.c
+++ b/gdb/jv-valprint.c
@@ -202,7 +202,7 @@ java_value_print (value_ptr val, struct ui_file *stream, int format,
&& strcmp (TYPE_NAME (TYPE_TARGET_TYPE (type)), "java.lang.String") == 0
&& (format == 0 || format == 's')
&& address != 0
- && value_as_pointer (val) != 0)
+ && value_as_address (val) != 0)
{
value_ptr data_val;
CORE_ADDR data;
@@ -215,13 +215,13 @@ java_value_print (value_ptr val, struct ui_file *stream, int format,
mark = value_mark (); /* Remember start of new values */
data_val = value_struct_elt (&val, NULL, "data", NULL, NULL);
- data = value_as_pointer (data_val);
+ data = value_as_address (data_val);
boffset_val = value_struct_elt (&val, NULL, "boffset", NULL, NULL);
- boffset = value_as_pointer (boffset_val);
+ boffset = value_as_address (boffset_val);
count_val = value_struct_elt (&val, NULL, "count", NULL, NULL);
- count = value_as_pointer (count_val);
+ count = value_as_address (count_val);
value_free_to_mark (mark); /* Release unnecessary values */
diff --git a/gdb/printcmd.c b/gdb/printcmd.c
index c601d88a74a..c798767c85d 100644
--- a/gdb/printcmd.c
+++ b/gdb/printcmd.c
@@ -1348,7 +1348,7 @@ x_command (char *exp, int from_tty)
&& VALUE_LVAL (val) == lval_memory)
next_address = VALUE_ADDRESS (val);
else
- next_address = value_as_pointer (val);
+ next_address = value_as_address (val);
if (VALUE_BFD_SECTION (val))
next_section = VALUE_BFD_SECTION (val);
do_cleanups (old_chain);
@@ -1586,7 +1586,7 @@ do_one_display (struct display *d)
printf_filtered (" ");
val = evaluate_expression (d->exp);
- addr = value_as_pointer (val);
+ addr = value_as_address (val);
if (d->format.format == 'i')
addr = ADDR_BITS_REMOVE (addr);
@@ -2244,7 +2244,7 @@ printf_command (char *arg, int from_tty)
char *str;
CORE_ADDR tem;
int j;
- tem = value_as_pointer (val_args[i]);
+ tem = value_as_address (val_args[i]);
/* This is a %s argument. Find the length of the string. */
for (j = 0;; j++)
diff --git a/gdb/stack.c b/gdb/stack.c
index f2536aa3195..4c7e5fa38f0 100644
--- a/gdb/stack.c
+++ b/gdb/stack.c
@@ -701,7 +701,7 @@ parse_frame_specification (char *frame_exp)
tmp_cleanup = make_cleanup (xfree, addr_string);
/* NOTE: we call parse_and_eval and then both
- value_as_long and value_as_pointer rather than calling
+ value_as_long and value_as_address rather than calling
parse_and_eval_long and parse_and_eval_address because
of the issue of potential side effects from evaluating
the expression. */
@@ -709,7 +709,7 @@ parse_frame_specification (char *frame_exp)
if (numargs == 0)
level = value_as_long (vp);
- args[numargs++] = value_as_pointer (vp);
+ args[numargs++] = value_as_address (vp);
do_cleanups (tmp_cleanup);
}
diff --git a/gdb/top.c b/gdb/top.c
index d57f0b57317..7cdc4bdf0b1 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -1436,7 +1436,7 @@ get_prompt_1 (void *data)
break;
case TYPE_CODE_PTR:
elt_type = check_typedef (TYPE_TARGET_TYPE (arg_type));
- addrval = value_as_pointer (arg_val);
+ addrval = value_as_address (arg_val);
if (TYPE_LENGTH (elt_type) == 1 &&
TYPE_CODE (elt_type) == TYPE_CODE_INT &&
diff --git a/gdb/valarith.c b/gdb/valarith.c
index a9ba5c76e02..0696b322a47 100644
--- a/gdb/valarith.c
+++ b/gdb/valarith.c
@@ -80,7 +80,7 @@ value_add (value_ptr arg1, value_ptr arg2)
if (len == 0)
len = 1; /* For (void *) */
retval = value_from_pointer (valptrtype,
- value_as_pointer (valptr)
+ value_as_address (valptr)
+ (len * value_as_long (valint)));
VALUE_BFD_SECTION (retval) = VALUE_BFD_SECTION (valptr);
return retval;
@@ -105,7 +105,7 @@ value_sub (value_ptr arg1, value_ptr arg2)
/* pointer - integer. */
LONGEST sz = TYPE_LENGTH (check_typedef (TYPE_TARGET_TYPE (type1)));
return value_from_pointer (type1,
- (value_as_pointer (arg1)
+ (value_as_address (arg1)
- (sz * value_as_long (arg2))));
}
else if (TYPE_CODE (type2) == TYPE_CODE_PTR
@@ -1199,9 +1199,9 @@ value_equal (register value_ptr arg1, register value_ptr arg2)
/* FIXME: Need to promote to either CORE_ADDR or LONGEST, whichever
is bigger. */
else if (code1 == TYPE_CODE_PTR && (code2 == TYPE_CODE_INT || code2 == TYPE_CODE_BOOL))
- return value_as_pointer (arg1) == (CORE_ADDR) value_as_long (arg2);
+ return value_as_address (arg1) == (CORE_ADDR) value_as_long (arg2);
else if (code2 == TYPE_CODE_PTR && (code1 == TYPE_CODE_INT || code1 == TYPE_CODE_BOOL))
- return (CORE_ADDR) value_as_long (arg1) == value_as_pointer (arg2);
+ return (CORE_ADDR) value_as_long (arg1) == value_as_address (arg2);
else if (code1 == code2
&& ((len = (int) TYPE_LENGTH (type1))
@@ -1253,14 +1253,14 @@ value_less (register value_ptr arg1, register value_ptr arg2)
&& (code2 == TYPE_CODE_FLT || code2 == TYPE_CODE_INT || code2 == TYPE_CODE_BOOL))
return value_as_double (arg1) < value_as_double (arg2);
else if (code1 == TYPE_CODE_PTR && code2 == TYPE_CODE_PTR)
- return value_as_pointer (arg1) < value_as_pointer (arg2);
+ return value_as_address (arg1) < value_as_address (arg2);
/* FIXME: Need to promote to either CORE_ADDR or LONGEST, whichever
is bigger. */
else if (code1 == TYPE_CODE_PTR && (code2 == TYPE_CODE_INT || code2 == TYPE_CODE_BOOL))
- return value_as_pointer (arg1) < (CORE_ADDR) value_as_long (arg2);
+ return value_as_address (arg1) < (CORE_ADDR) value_as_long (arg2);
else if (code2 == TYPE_CODE_PTR && (code1 == TYPE_CODE_INT || code1 == TYPE_CODE_BOOL))
- return (CORE_ADDR) value_as_long (arg1) < value_as_pointer (arg2);
+ return (CORE_ADDR) value_as_long (arg1) < value_as_address (arg2);
else if (code1 == TYPE_CODE_STRING && code2 == TYPE_CODE_STRING)
return value_strcmp (arg1, arg2) < 0;
else
diff --git a/gdb/valops.c b/gdb/valops.c
index e1a4bc53d01..22c6948b0e5 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -970,7 +970,7 @@ value_ind (value_ptr arg1)
enc_type = TYPE_TARGET_TYPE (enc_type);
/* Retrieve the enclosing object pointed to */
arg2 = value_at_lazy (enc_type,
- value_as_pointer (arg1) - VALUE_POINTED_TO_OFFSET (arg1),
+ value_as_address (arg1) - VALUE_POINTED_TO_OFFSET (arg1),
VALUE_BFD_SECTION (arg1));
/* Re-adjust type */
VALUE_TYPE (arg2) = TYPE_TARGET_TYPE (base_type);
@@ -1221,7 +1221,7 @@ find_function_addr (value_ptr function, struct type **retval_type)
}
else if (code == TYPE_CODE_PTR)
{
- funaddr = value_as_pointer (function);
+ funaddr = value_as_address (function);
ftype = check_typedef (TYPE_TARGET_TYPE (ftype));
if (TYPE_CODE (ftype) == TYPE_CODE_FUNC
|| TYPE_CODE (ftype) == TYPE_CODE_METHOD)
@@ -1237,7 +1237,7 @@ find_function_addr (value_ptr function, struct type **retval_type)
/* Handle the case of functions lacking debugging info.
Their values are characters since their addresses are char */
if (TYPE_LENGTH (ftype) == 1)
- funaddr = value_as_pointer (value_addr (function));
+ funaddr = value_as_address (value_addr (function));
else
/* Handle integer used as address of a function. */
funaddr = (CORE_ADDR) value_as_long (function);
diff --git a/gdb/value.h b/gdb/value.h
index 5db5f1156e4..041933117a8 100644
--- a/gdb/value.h
+++ b/gdb/value.h
@@ -289,7 +289,7 @@ extern LONGEST value_as_long (value_ptr val);
extern DOUBLEST value_as_double (value_ptr val);
-extern CORE_ADDR value_as_pointer (value_ptr val);
+extern CORE_ADDR value_as_address (value_ptr val);
extern LONGEST unpack_long (struct type *type, char *valaddr);
diff --git a/gdb/values.c b/gdb/values.c
index bf032af358f..eedeaf96057 100644
--- a/gdb/values.c
+++ b/gdb/values.c
@@ -561,7 +561,7 @@ value_as_double (register value_ptr val)
Note that val's type may not actually be a pointer; value_as_long
handles all the cases. */
CORE_ADDR
-value_as_pointer (value_ptr val)
+value_as_address (value_ptr val)
{
/* Assume a CORE_ADDR can fit in a LONGEST (for now). Not sure
whether we want this to be true eventually. */
@@ -723,7 +723,7 @@ unpack_double (struct type *type, char *valaddr, int *invp)
host byte order.
If you want functions and arrays to be coerced to pointers, and
- references to be dereferenced, call value_as_pointer() instead.
+ references to be dereferenced, call value_as_address() instead.
C++: It is assumed that the front-end has taken care of
all matters concerning pointers to members. A pointer
@@ -993,7 +993,7 @@ value_headof (value_ptr in_arg, struct type *btype, struct type *dtype)
/* Turn vtable into typeinfo function */
VALUE_OFFSET(vtbl)+=4;
- msymbol = lookup_minimal_symbol_by_pc ( value_as_pointer(value_ind(vtbl)) );
+ msymbol = lookup_minimal_symbol_by_pc ( value_as_address(value_ind(vtbl)) );
if (msymbol == NULL
|| (demangled_name = SYMBOL_NAME (msymbol)) == NULL)
{