summaryrefslogtreecommitdiff
path: root/gdb/c-valprint.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2022-07-30 22:43:54 -0400
committerSimon Marchi <simon.marchi@polymtl.ca>2022-09-21 10:59:49 -0400
commit27710edb4e588d0360620df424dd7ee7e8cfafee (patch)
treeaf4da9f4c7e032ab6653536f2a991cbe09cee759 /gdb/c-valprint.c
parent8a50fdcefc44c40d5c4b978f19c22ddfbeb29139 (diff)
downloadbinutils-gdb-27710edb4e588d0360620df424dd7ee7e8cfafee.tar.gz
gdb: remove TYPE_TARGET_TYPE
Remove the macro, replace all uses by calls to type::target_type. Change-Id: Ie51d3e1e22f94130176d6abd723255282bb6d1ed
Diffstat (limited to 'gdb/c-valprint.c')
-rw-r--r--gdb/c-valprint.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c
index bd445588ca0..a93280c6685 100644
--- a/gdb/c-valprint.c
+++ b/gdb/c-valprint.c
@@ -87,8 +87,8 @@ c_textual_element_type (struct type *type, char format)
/* Peel a single typedef. If the typedef doesn't have a target
type, we use check_typedef and hope the result is ok -- it
might be for C++, where wchar_t is a built-in type. */
- if (TYPE_TARGET_TYPE (iter_type))
- iter_type = TYPE_TARGET_TYPE (iter_type);
+ if (iter_type->target_type ())
+ iter_type = iter_type->target_type ();
else
iter_type = check_typedef (iter_type);
}
@@ -238,7 +238,7 @@ c_value_print_array (struct value *val,
struct type *type = check_typedef (value_type (val));
CORE_ADDR address = value_address (val);
const gdb_byte *valaddr = value_contents_for_printing (val).data ();
- struct type *unresolved_elttype = TYPE_TARGET_TYPE (type);
+ struct type *unresolved_elttype = type->target_type ();
struct type *elttype = check_typedef (unresolved_elttype);
if (TYPE_LENGTH (type) > 0 && TYPE_LENGTH (unresolved_elttype) > 0)
@@ -347,7 +347,7 @@ c_value_print_ptr (struct value *val, struct ui_file *stream, int recurse,
}
else
{
- struct type *unresolved_elttype = TYPE_TARGET_TYPE (type);
+ struct type *unresolved_elttype = type->target_type ();
struct type *elttype = check_typedef (unresolved_elttype);
CORE_ADDR addr = unpack_pointer (type, valaddr);
@@ -497,15 +497,15 @@ c_value_print (struct value *val, struct ui_file *stream,
are always exactly (char *), (wchar_t *), or the like. */
if (original_type->code () == TYPE_CODE_PTR
&& original_type->name () == NULL
- && TYPE_TARGET_TYPE (original_type)->name () != NULL
- && (strcmp (TYPE_TARGET_TYPE (original_type)->name (),
+ && original_type->target_type ()->name () != NULL
+ && (strcmp (original_type->target_type ()->name (),
"char") == 0
- || textual_name (TYPE_TARGET_TYPE (original_type)->name ())))
+ || textual_name (original_type->target_type ()->name ())))
{
/* Print nothing. */
}
else if (options->objectprint
- && (TYPE_TARGET_TYPE (type)->code () == TYPE_CODE_STRUCT))
+ && (type->target_type ()->code () == TYPE_CODE_STRUCT))
{
int is_ref = TYPE_IS_REFERENCE (type);
enum type_code refcode = TYPE_CODE_UNDEF;