aboutsummaryrefslogtreecommitdiff
path: root/gdb/valprint.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2020-05-22 16:55:15 -0400
committerSimon Marchi <simon.marchi@efficios.com>2020-05-22 16:55:15 -0400
commit1f704f761b34e145f5eabdc222301ce6e9ec9102 (patch)
tree89c8b6dbf40b606ef045929b718d9271093057a3 /gdb/valprint.c
parent5e33d5f4e1a5f2c3556ee31715ddc030d039b597 (diff)
downloadgdb-1f704f761b34e145f5eabdc222301ce6e9ec9102.zip
gdb-1f704f761b34e145f5eabdc222301ce6e9ec9102.tar.gz
gdb-1f704f761b34e145f5eabdc222301ce6e9ec9102.tar.bz2
gdb: remove TYPE_NFIELDS macro
Remove `TYPE_NFIELDS`, changing all the call sites to use `type::num_fields` directly. This is quite a big diff, but this was mostly done using sed and coccinelle. A few call sites were done by hand. gdb/ChangeLog: * gdbtypes.h (TYPE_NFIELDS): Remove. Change all cal sites to use type::num_fields instead. Change-Id: Ib73be4c36f9e770e0f729bac3b5257d7cb2f9591
Diffstat (limited to 'gdb/valprint.c')
-rw-r--r--gdb/valprint.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/valprint.c b/gdb/valprint.c
index 4bd643e..17d091d 100644
--- a/gdb/valprint.c
+++ b/gdb/valprint.c
@@ -587,7 +587,7 @@ generic_val_print_enum_1 (struct type *type, LONGEST val,
unsigned int i;
unsigned int len;
- len = TYPE_NFIELDS (type);
+ len = type->num_fields ();
for (i = 0; i < len; i++)
{
QUIT;
@@ -1135,7 +1135,7 @@ val_print_type_code_flags (struct type *type, struct value *original_value,
const gdb_byte *valaddr = (value_contents_for_printing (original_value)
+ embedded_offset);
ULONGEST val = unpack_long (type, valaddr);
- int field, nfields = TYPE_NFIELDS (type);
+ int field, nfields = type->num_fields ();
struct gdbarch *gdbarch = get_type_arch (type);
struct type *bool_type = builtin_type (gdbarch)->builtin_bool;