aboutsummaryrefslogtreecommitdiff
path: root/gdb/eval.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/eval.c
parent5e33d5f4e1a5f2c3556ee31715ddc030d039b597 (diff)
downloadbinutils-1f704f761b34e145f5eabdc222301ce6e9ec9102.zip
binutils-1f704f761b34e145f5eabdc222301ce6e9ec9102.tar.gz
binutils-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/eval.c')
-rw-r--r--gdb/eval.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gdb/eval.c b/gdb/eval.c
index 023b629..8104c95 100644
--- a/gdb/eval.c
+++ b/gdb/eval.c
@@ -295,11 +295,11 @@ evaluate_struct_tuple (struct value *struct_val,
fieldno++;
/* Skip static fields. */
- while (fieldno < TYPE_NFIELDS (struct_type)
+ while (fieldno < struct_type->num_fields ()
&& field_is_static (&TYPE_FIELD (struct_type,
fieldno)))
fieldno++;
- if (fieldno >= TYPE_NFIELDS (struct_type))
+ if (fieldno >= struct_type->num_fields ())
error (_("too many initializers"));
field_type = TYPE_FIELD_TYPE (struct_type, fieldno);
if (field_type->code () == TYPE_CODE_UNION
@@ -1058,7 +1058,7 @@ evaluate_funcall (type *expect_type, expression *exp, int *pos,
type = TYPE_TARGET_TYPE (type);
if (type && type->code () == TYPE_CODE_FUNC)
{
- for (; tem <= nargs && tem <= TYPE_NFIELDS (type); tem++)
+ for (; tem <= nargs && tem <= type->num_fields (); tem++)
{
argvec[tem] = evaluate_subexp (TYPE_FIELD_TYPE (type,
tem - 1),