This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: tracepoints implementation: bug in byte code generating.
> Josef Ezra wrote:
> >
> > 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
>
> Josef, your change is good, but let me make it better
> and feed it back to you for YOUR approval. In the process,
> I'll show you what we would like submissions to look like.
>
> Your problem description is fine, but this is what a
> change log entry looks like:
>
> 2000-10-19 Josef Ezra <jezra@emc.com>
>
> * 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.
>
> And there is already a gdb function called CHECK_TYPEDEF
> for doing what you want to do:
>
> *** ax-gdb.c 2000/07/30 01:48:24 1.6
> --- ax-gdb.c 2000/10/19 17:31:08
> *************** gen_struct_ref (struct agent_expr *ax, s
> *** 1342,1348 ****
> gen_usual_unary (ax, value);
> gen_deref (ax, value);
> }
> ! type = value->type;
>
> /* This must yield a structure or a union. */
> if (TYPE_CODE (type) != TYPE_CODE_STRUCT
> --- 1342,1348 ----
> gen_usual_unary (ax, value);
> gen_deref (ax, value);
> }
> ! type = CHECK_TYPEDEF (value->type);
>
> /* This must yield a structure or a union. */
> if (TYPE_CODE (type) != TYPE_CODE_STRUCT
>
> OK for me to accept your change as modified?
> Thanks,
> Michael Snyder
>
Michael
1. Your code is better. I can't resist this modification.
2. In the future, I will try to follow change-log-entry roles, sorry for
this one.
3. I would like to add commands to the remote protocol, is there a gnu
routine to standardizes some of those changed?
Thanks again
Josef Ezra