This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Add autocompletion for convenience vars in print and set


>>>>> "Daniel" == Daniel Gutson <daniel.gutson@tallertechnologies.com> writes:

Daniel> I could not find any testsuite where to add tests for this; if
Daniel> there are, please let me know.

See testsuite/gdb.base/completion.exp

Daniel>  exp	:	VARIABLE
Daniel>  			{
Daniel> -			  write_dollar_variable (pstate, $1);
Daniel> +			  if (!parse_completion)
Daniel> +			    write_dollar_variable (pstate, $1);
Daniel>  			}

I think this isn't correct.  I think it won't work if you try to
complete on a field name where the "LHS" has a convenience variable.
That is something like:

   set $var = (struct x *) malloc (...)
   complete print $var.somethin

Instead I think you need a new production, like "exp : VARIABLE COMPLETE".

Daniel> +  if (p != NULL && *p == '$')
Daniel> +    return complete_internalvar (p + 1);

I'm not sure this is correct either, but offhand I don't know.
Should it not look at "word"?

Daniel> +  VEC (char_ptr) * ret = current_language->la_make_symbol_completion_list (
Daniel> +                                                      text, word,
Daniel> +                                                      TYPE_CODE_UNDEF);

No space before "ret".
The line breaks look odd, I would break before the "=" and not after the "(".

thanks,
Tom


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]