This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA libiberty, gdb] Add hashtab support to filename_ncmp.c and use it in gdb.
- From: Doug Evans <dje at google dot com>
- To: Steven Bosscher <stevenb dot gcc at gmail dot com>
- Cc: gcc-patches at gcc dot gnu dot org, gdb-patches <gdb-patches at sourceware dot org>
- Date: Mon, 9 Jul 2012 12:49:05 -0700
- Subject: Re: [RFA libiberty, gdb] Add hashtab support to filename_ncmp.c and use it in gdb.
- References: <20120709181015.2FCA41E13A1@ruffy2.mtv.corp.google.com> <CABu31nPhJ_3+yCNCArF7P3+Z+13cXVSoTqUyn1rKKQXv4+oVUA@mail.gmail.com>
[- gdb, + gdb-patches]
On Mon, Jul 9, 2012 at 11:51 AM, Steven Bosscher <stevenb.gcc@gmail.com> wrote:
> On Mon, Jul 9, 2012 at 8:10 PM, Doug Evans <dje@google.com> 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
[blech, my first reply got turned into rich html]
Hi.
Given that filename_cmp.c lives in libiberty, putting related
functions together makes it easier to maintain them.
If you're suggesting writing a function that takes a file name and
returns a canonicalized name that will then work with
htab_hash_string, that's more expensive and I don't see the benefit.