This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH]
> >> 2012-01-18 Sergio Durigan Junior <sergiodj@redhat.com>
> >>
> >> * parse.c (initialize_expout): New function.
> >> (reallocate_expout): Likewise.
> >> (parse_exp_in_context): Use `initialize_expout' and
> >> `reallocate_expout' when appropriate.
> >
> > FWIW, it seems OK to me on its own. I like the fact that you made
> > the initial_size and gdbarch parameters.
Sorry for nit-picking, but since it's very minor and can easily
be deal with...
> +/* Helper function used to initialize an struct expression that is going
> + to be used to store expression elements. The arguments are the
> + INITIAL_SIZE of the expression, the language LANG parsed to build this
> + expression, and the GDBARCH pointer. */
Suggested re-phrasing:
/* Helper function to initialize the expout, expout_size, expout_ptr
trio before it is used to store expression elements created during
the parsing of an expression. INITIAL_SIZE is the initial size of
the expout array. LANG is the language used to parse the expression.
And GDBARCH is the gdbarch to use during parsing. */
> +/* Helper function that reallocates the EXPOUT in order to eliminate any
> + unused space. It is generally used when the expression has just been
> + parsed and created. */
Suggest:
/* Helper function that frees any unsed space in the expout array.
It is generally used when the parser has just been parsed and
created. */
(otherwise, remove "the" before "EXPOUT").
Ok with those fixes.
--
Joel