tracepoints implementation: bug in byte code generating.
Josef Ezra
jezra@emc.com
Thu Oct 19 07:24:00 GMT 2000
Generating code for remote traces, the case of "pointer1->pointer2->data"
was not covered if pointer2's declaration involved a typedef. This simple
fix should take care of that by checking the target type whenever the code
is TYPE_CODE_TYPEDEF.
Regards - Josef Ezra
-------------- next part --------------
* while generating data code, cases of "collect p1->p2->data" where not
covered if p2 is a 'typedefed' type. this simple fix should forward
the type pointer to the real type.
Index: ax-gdb.c
===================================================================
RCS file: /emc/ucode/cvsroot_0/sgdb6/gdb/ax-gdb.c,v
retrieving revision 1.2
diff -c -5 -p -r1.2 ax-gdb.c
*** ax-gdb.c 2000/10/19 13:33:24 1.2
--- ax-gdb.c 2000/10/19 13:42:56
*************** gen_struct_ref (ax, value, field, operat
*** 1428,1437 ****
--- 1428,1442 ----
gen_usual_unary (ax, value);
gen_deref (ax, value);
}
type = value->type;
+ /* if this is a typedef we are more interested at the target */
+ while (TYPE_CODE (type) == TYPE_CODE_TYPEDEF
+ && TYPE_TARGET_TYPE (type) != NULL)
+ type = TYPE_TARGET_TYPE (type) ;
+
/* This must yield a structure or a union. */
if (TYPE_CODE (type) != TYPE_CODE_STRUCT
&& TYPE_CODE (type) != TYPE_CODE_UNION)
error ("The left operand of `%s' is not a %s.",
operator_name, operand_name);
More information about the Gdb-patches
mailing list