From d0c9791728caa0d3b3270a997c7fd97919976c97 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Tue, 31 Jan 2023 07:52:09 -0700 Subject: 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 --- gdb/cli/cli-cmds.c | 2 +- gdb/cli/cli-dump.c | 4 ++-- gdb/cli/cli-utils.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'gdb/cli') 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 { -- cgit v1.1