[RFA] Make symbol completion language-specific

Daniel Jacobowitz drow@false.org
Mon Feb 4 23:30:00 GMT 2008


On Mon, Feb 04, 2008 at 03:15:10PM -0800, Joel Brobecker wrote:
> I just had a look, and I don't think the generic VEC integrates itself
> well with the current infrastructure.  The type above works well,
> because I can then directly pass the char **array back to the caller
> of our completion routine (one of the callers is responsible for
> freeing it - see completer.c:line_completion_function).
> 
> If I were to use a VEC, I would have to return a copy of the contents
> of the VEC, which seems silly because I'd end up immediately destroying
> an array that I just copied.

It still saves you having to write your own push and pop.  But, hey,
you already have them... Personally I'd rather do the copy than have
my own set of accessors, but that's only my preference.

> I propose the following:
> 
>   - I check the current patch in, as is (with an extra comment
>     explaining why we're not using a VEC).
> 
>   - I can work on a follow-up patch that changes the inferface of
>     the completer to use VECs instead of a NULL-terminated arrays.
>     It's unclear how much benefit it's going to bring, but I could
>     work on that relatively soon.

I don't think the second step is even worthwhile.  Objection
withdrawn.

-- 
Daniel Jacobowitz
CodeSourcery



More information about the Gdb-patches mailing list