This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 4/6] Remove 'substruct_type' and 'subfieldno'.
gdb:
2012-11-01 Yao Qi <yao@codesourcery.com>
* eval.c (evaluate_struct_tuple): Replace 'substruct_type' with
'struct_type'. Replace 'subfieldno' with 'fieldno'.
---
gdb/eval.c | 7 ++-----
1 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/gdb/eval.c b/gdb/eval.c
index 3eb4896..62b26a9 100644
--- a/gdb/eval.c
+++ b/gdb/eval.c
@@ -287,10 +287,8 @@ evaluate_struct_tuple (struct value *struct_val,
int *pos, enum noside noside, int nargs)
{
struct type *struct_type = check_typedef (value_type (struct_val));
- struct type *substruct_type = struct_type;
struct type *field_type;
int fieldno = -1;
- int subfieldno = -1;
while (--nargs >= 0)
{
@@ -306,7 +304,6 @@ evaluate_struct_tuple (struct value *struct_val,
&& field_is_static (&TYPE_FIELD (struct_type,
fieldno)))
fieldno++;
- subfieldno = fieldno;
if (fieldno >= TYPE_NFIELDS (struct_type))
error (_("too many initializers"));
field_type = TYPE_FIELD_TYPE (struct_type, fieldno);
@@ -325,7 +322,7 @@ evaluate_struct_tuple (struct value *struct_val,
subfieldno is the index of the actual real (named inner) field
in substruct_type. */
- field_type = TYPE_FIELD_TYPE (substruct_type, subfieldno);
+ field_type = TYPE_FIELD_TYPE (struct_type, fieldno);
if (val == 0)
val = evaluate_subexp (field_type, exp, pos, noside);
@@ -335,7 +332,7 @@ evaluate_struct_tuple (struct value *struct_val,
if (value_type (val) != field_type)
val = value_cast (field_type, val);
- bitsize = TYPE_FIELD_BITSIZE (substruct_type, subfieldno);
+ bitsize = TYPE_FIELD_BITSIZE (struct_type, fieldno);
bitpos = TYPE_FIELD_BITPOS (struct_type, fieldno);
addr = value_contents_writeable (struct_val) + bitpos / 8;
if (bitsize)
--
1.7.7.6