aboutsummaryrefslogtreecommitdiff
path: root/gdb/guile
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2023-01-31 07:52:09 -0700
committerTom Tromey <tom@tromey.com>2023-02-13 15:21:06 -0700
commitd0c9791728caa0d3b3270a997c7fd97919976c97 (patch)
tree1753b7232efa89e05696d4289d60ad019fc161e4 /gdb/guile
parent7cf57bc5be656c62cc6b80280a9eddad2b8ded3f (diff)
downloadfsf-binutils-gdb-d0c9791728caa0d3b3270a997c7fd97919976c97.zip
fsf-binutils-gdb-d0c9791728caa0d3b3270a997c7fd97919976c97.tar.gz
fsf-binutils-gdb-d0c9791728caa0d3b3270a997c7fd97919976c97.tar.bz2
Turn value_type into method
This changes value_type to be a method of value. Much of this patch was written by script. Approved-By: Simon Marchi <simon.marchi@efficios.com>
Diffstat (limited to 'gdb/guile')
-rw-r--r--gdb/guile/scm-math.c10
-rw-r--r--gdb/guile/scm-pretty-print.c2
-rw-r--r--gdb/guile/scm-value.c22
3 files changed, 17 insertions, 17 deletions
diff --git a/gdb/guile/scm-math.c b/gdb/guile/scm-math.c
index 26019b4..af472c1 100644
--- a/gdb/guile/scm-math.c
+++ b/gdb/guile/scm-math.c
@@ -109,7 +109,7 @@ vlscm_unop_gdbthrow (enum valscm_unary_opcode opcode, SCM x,
res_val = arg1;
break;
case VALSCM_ABS:
- if (value_less (arg1, value_zero (value_type (arg1), not_lval)))
+ if (value_less (arg1, value_zero (arg1->type (), not_lval)))
res_val = value_neg (arg1);
else
res_val = arg1;
@@ -160,8 +160,8 @@ vlscm_binop_gdbthrow (enum valscm_binary_opcode opcode, SCM x, SCM y,
{
case VALSCM_ADD:
{
- struct type *ltype = value_type (arg1);
- struct type *rtype = value_type (arg2);
+ struct type *ltype = arg1->type ();
+ struct type *rtype = arg2->type ();
ltype = check_typedef (ltype);
ltype = STRIP_REFERENCE (ltype);
@@ -180,8 +180,8 @@ vlscm_binop_gdbthrow (enum valscm_binary_opcode opcode, SCM x, SCM y,
break;
case VALSCM_SUB:
{
- struct type *ltype = value_type (arg1);
- struct type *rtype = value_type (arg2);
+ struct type *ltype = arg1->type ();
+ struct type *rtype = arg2->type ();
ltype = check_typedef (ltype);
ltype = STRIP_REFERENCE (ltype);
diff --git a/gdb/guile/scm-pretty-print.c b/gdb/guile/scm-pretty-print.c
index cb6677c..3e93f35 100644
--- a/gdb/guile/scm-pretty-print.c
+++ b/gdb/guile/scm-pretty-print.c
@@ -956,7 +956,7 @@ gdbscm_apply_val_pretty_printer (const struct extension_language_defn *extlang,
const struct value_print_options *options,
const struct language_defn *language)
{
- struct type *type = value_type (value);
+ struct type *type = value->type ();
struct gdbarch *gdbarch = type->arch ();
SCM exception = SCM_BOOL_F;
SCM printer = SCM_BOOL_F;
diff --git a/gdb/guile/scm-value.c b/gdb/guile/scm-value.c
index b994830..0d9e15a 100644
--- a/gdb/guile/scm-value.c
+++ b/gdb/guile/scm-value.c
@@ -470,7 +470,7 @@ gdbscm_value_referenced_value (SCM self)
struct value *res_val;
- switch (check_typedef (value_type (value))->code ())
+ switch (check_typedef (value->type ())->code ())
{
case TYPE_CODE_PTR:
res_val = value_ind (value);
@@ -548,7 +548,7 @@ gdbscm_value_type (SCM self)
struct value *value = v_smob->value;
if (SCM_UNBNDP (v_smob->type))
- v_smob->type = tyscm_scm_from_type (value_type (value));
+ v_smob->type = tyscm_scm_from_type (value->type ());
return v_smob->type;
}
@@ -571,7 +571,7 @@ gdbscm_value_dynamic_type (SCM self)
{
scoped_value_mark free_values;
- type = value_type (value);
+ type = value->type ();
type = check_typedef (type);
if (((type->code () == TYPE_CODE_PTR)
@@ -710,7 +710,7 @@ gdbscm_value_subscript (SCM self, SCM index_scm)
value_smob *v_smob
= vlscm_get_value_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
struct value *value = v_smob->value;
- struct type *type = value_type (value);
+ struct type *type = value->type ();
SCM_ASSERT (type != NULL, self, SCM_ARG2, FUNC_NAME);
@@ -732,7 +732,7 @@ gdbscm_value_subscript (SCM self, SCM index_scm)
Check the value's type is something that can be accessed via
a subscript. */
struct value *tmp = coerce_ref (value);
- struct type *tmp_type = check_typedef (value_type (tmp));
+ struct type *tmp_type = check_typedef (tmp->type ());
if (tmp_type->code () != TYPE_CODE_ARRAY
&& tmp_type->code () != TYPE_CODE_PTR)
error (_("Cannot subscript requested type"));
@@ -758,7 +758,7 @@ gdbscm_value_call (SCM self, SCM args)
gdbscm_gdb_exception exc {};
try
{
- ftype = check_typedef (value_type (function));
+ ftype = check_typedef (function->type ());
}
catch (const gdb_exception &except)
{
@@ -821,7 +821,7 @@ gdbscm_value_to_bytevector (SCM self)
const gdb_byte *contents = NULL;
SCM bv;
- type = value_type (value);
+ type = value->type ();
gdbscm_gdb_exception exc {};
try
@@ -866,7 +866,7 @@ gdbscm_value_to_bool (SCM self)
struct type *type;
LONGEST l = 0;
- type = value_type (value);
+ type = value->type ();
gdbscm_gdb_exception exc {};
try
@@ -910,7 +910,7 @@ gdbscm_value_to_integer (SCM self)
struct type *type;
LONGEST l = 0;
- type = value_type (value);
+ type = value->type ();
gdbscm_gdb_exception exc {};
try
@@ -958,7 +958,7 @@ gdbscm_value_to_real (SCM self)
double d = 0;
struct value *check = nullptr;
- type = value_type (value);
+ type = value->type ();
gdbscm_gdb_exception exc {};
try
@@ -1162,7 +1162,7 @@ gdbscm_value_to_lazy_string (SCM self, SCM rest)
struct type *type, *realtype;
CORE_ADDR addr;
- type = value_type (value);
+ type = value->type ();
realtype = check_typedef (type);
switch (realtype->code ())