aboutsummaryrefslogtreecommitdiff
path: root/gdb/cli
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/cli
parent7cf57bc5be656c62cc6b80280a9eddad2b8ded3f (diff)
downloadgdb-d0c9791728caa0d3b3270a997c7fd97919976c97.zip
gdb-d0c9791728caa0d3b3270a997c7fd97919976c97.tar.gz
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/cli')
-rw-r--r--gdb/cli/cli-cmds.c2
-rw-r--r--gdb/cli/cli-dump.c4
-rw-r--r--gdb/cli/cli-utils.c4
3 files changed, 5 insertions, 5 deletions
diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c
index 6c0d780..7267d60 100644
--- a/gdb/cli/cli-cmds.c
+++ b/gdb/cli/cli-cmds.c
@@ -2190,7 +2190,7 @@ setting_cmd (const char *fnname, struct cmd_list_element *showlist,
if (argc != 1)
error (_("You can only provide one argument to %s"), fnname);
- struct type *type0 = check_typedef (value_type (argv[0]));
+ struct type *type0 = check_typedef (argv[0]->type ());
if (type0->code () != TYPE_CODE_ARRAY
&& type0->code () != TYPE_CODE_STRING)
diff --git a/gdb/cli/cli-dump.c b/gdb/cli/cli-dump.c
index a8811c4..e1d40c0 100644
--- a/gdb/cli/cli-dump.c
+++ b/gdb/cli/cli-dump.c
@@ -225,7 +225,7 @@ dump_value_to_file (const char *cmd, const char *mode, const char *file_format)
/* Have everything. Open/write the data. */
if (file_format == NULL || strcmp (file_format, "binary") == 0)
dump_binary_file (filename.get (), mode, value_contents (val).data (),
- value_type (val)->length ());
+ val->type ()->length ());
else
{
CORE_ADDR vaddr;
@@ -242,7 +242,7 @@ dump_value_to_file (const char *cmd, const char *mode, const char *file_format)
dump_bfd_file (filename.get (), mode, file_format, vaddr,
value_contents (val).data (),
- value_type (val)->length ());
+ val->type ()->length ());
}
}
diff --git a/gdb/cli/cli-utils.c b/gdb/cli/cli-utils.c
index 81c3c72..b78568e 100644
--- a/gdb/cli/cli-utils.c
+++ b/gdb/cli/cli-utils.c
@@ -37,7 +37,7 @@ get_ulongest (const char **pp, int trailer)
if (val != NULL) /* Value history reference */
{
- if (value_type (val)->code () == TYPE_CODE_INT)
+ if (val->type ()->code () == TYPE_CODE_INT)
retval = value_as_long (val);
else
error (_("History value must have integer type."));
@@ -96,7 +96,7 @@ get_number_trailer (const char **pp, int trailer)
if (val) /* Value history reference */
{
- if (value_type (val)->code () == TYPE_CODE_INT)
+ if (val->type ()->code () == TYPE_CODE_INT)
retval = value_as_long (val);
else
{