Re: [RFA libiberty, gdb] Add hashtab support to filename_ncmp.c and use it in gdb.

2012-07-14 Thread Tom Tromey
> "Eli" == Eli Zaretskii writes: Eli> I understand all that, but why would the eq_f function need to be an Eli> external function on its own? It is just to avoid other users having to write their own. Eli> E.g., if we were to write a qsort replacement, would we have a Eli> suitable string c

Re: [RFA libiberty, gdb] Add hashtab support to filename_ncmp.c and use it in gdb.

2012-07-13 Thread Eli Zaretskii
> Date: Fri, 13 Jul 2012 14:26:15 -0700 > From: Doug Evans > Cc: d...@redhat.com, gcc-patches@gcc.gnu.org, gdb-patc...@sourceware.org > > > Sorry if I'm missing something, but why do we need to advertise such a > > function at all? Given that libiberty already provides filename_cmp, > > isn't it

Re: [RFA libiberty, gdb] Add hashtab support to filename_ncmp.c and use it in gdb.

2012-07-13 Thread Doug Evans
On Fri, Jul 13, 2012 at 12:47 PM, Eli Zaretskii wrote: >> Date: Fri, 13 Jul 2012 12:36:44 -0700 >> From: Doug Evans >> Cc: gcc-patches@gcc.gnu.org, gdb-patc...@sourceware.org >> >> On Fri, Jul 13, 2012 at 12:21 PM, DJ Delorie wrote: >> > >> > I think it's confusing to have filename_cmp and filen

Re: [RFA libiberty, gdb] Add hashtab support to filename_ncmp.c and use it in gdb.

2012-07-13 Thread Eli Zaretskii
> Date: Fri, 13 Jul 2012 12:36:44 -0700 > From: Doug Evans > Cc: gcc-patches@gcc.gnu.org, gdb-patc...@sourceware.org > > On Fri, Jul 13, 2012 at 12:21 PM, DJ Delorie wrote: > > > > I think it's confusing to have filename_cmp and filename_eq that do > > basically the same thing. Perhaps filename

Re: [RFA libiberty, gdb] Add hashtab support to filename_ncmp.c and use it in gdb.

2012-07-13 Thread DJ Delorie
If there's precedent, I'm not worried about it. Ok to check in.

Re: [RFA libiberty, gdb] Add hashtab support to filename_ncmp.c and use it in gdb.

2012-07-13 Thread Doug Evans
On Fri, Jul 13, 2012 at 12:21 PM, DJ Delorie wrote: > > I think it's confusing to have filename_cmp and filename_eq that do > basically the same thing. Perhaps filename_eq should be > filename_cmp_v or filename_cmp_hash or something, to indicate that > it's *supposed* to be the same functionality

Re: [RFA libiberty, gdb] Add hashtab support to filename_ncmp.c and use it in gdb.

2012-07-13 Thread DJ Delorie
I think it's confusing to have filename_cmp and filename_eq that do basically the same thing. Perhaps filename_eq should be filename_cmp_v or filename_cmp_hash or something, to indicate that it's *supposed* to be the same functionality as filename_cmp but with a different signature?

Re: [RFA libiberty, gdb] Add hashtab support to filename_ncmp.c and use it in gdb.

2012-07-13 Thread Doug Evans
Hi. "ping" [for the libiberty part] [The gdb part needs to be updated due to recent changes there, but I'm going to wait until the libiberty part is approved.] On Mon, Jul 9, 2012 at 11:10 AM, Doug Evans wrote: > Hi. > > filename_seen in gdb does a linear search, this patch changes it > to use

Re: [RFA libiberty, gdb] Add hashtab support to filename_ncmp.c and use it in gdb.

2012-07-09 Thread Doug Evans
[- gdb, + gdb-patches] On Mon, Jul 9, 2012 at 11:51 AM, Steven Bosscher wrote: > On Mon, Jul 9, 2012 at 8:10 PM, Doug Evans wrote: >> Hi. >> >> filename_seen in gdb does a linear search, this patch changes it >> to use a hash table. >> >> Ok to check in? > > Why not just use htab_hash_string? Th

Re: [RFA libiberty, gdb] Add hashtab support to filename_ncmp.c and use it in gdb.

2012-07-09 Thread Steven Bosscher
On Mon, Jul 9, 2012 at 8:10 PM, Doug Evans wrote: > Hi. > > filename_seen in gdb does a linear search, this patch changes it > to use a hash table. > > Ok to check in? Why not just use htab_hash_string? The file name canonicalization can be put in gdb itself. Ciao! Steven

[RFA libiberty, gdb] Add hashtab support to filename_ncmp.c and use it in gdb.

2012-07-09 Thread Doug Evans
Hi. filename_seen in gdb does a linear search, this patch changes it to use a hash table. Ok to check in? I couldn't think of a good reason to put filename_hash,filename_eq in gdb, and I like placing them close to where hashtab.c and filename_cmp are defined. I also couldn't think of a sufficien