Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: gdb-patches@sourceware.org
Subject: Re: [RFA] Make symbol completion language-specific
Date: Mon, 04 Feb 2008 23:15:00 -0000	[thread overview]
Message-ID: <20080204231510.GI21614@adacore.com> (raw)
In-Reply-To: <20080129172800.GA3773@caradoc.them.org>

Hi Daniel,

> > +struct string_vector
> > +{
> > +  char **array; /* The vector itself.  */
> > +  int index;    /* Index of the next available element in the array.  */
> > +  size_t size;  /* The number of entries allocated in the array.  */
> > +};
> 
> We have a generic VEC nowadays.

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.

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.

Thanks,
-- 
Joel


  parent reply	other threads:[~2008-02-04 23:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-28 13:07 Joel Brobecker
2008-01-29 17:35 ` Daniel Jacobowitz
2008-01-30 20:43   ` Joel Brobecker
2008-01-30 21:25     ` Daniel Jacobowitz
2008-02-04 23:15   ` Joel Brobecker [this message]
2008-02-04 23:30     ` Daniel Jacobowitz
2008-02-05 22:32       ` Joel Brobecker
2008-02-06  2:40         ` [RFA/commit/Ada] Replace home-made string_vector struct with VEC Joel Brobecker
2008-02-06  2:48           ` Daniel Jacobowitz
2008-02-07 19:14           ` Joel Brobecker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080204231510.GI21614@adacore.com \
    --to=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox