This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 1/5] Introduce build_debug_file_name
- From: Pedro Alves <palves at redhat dot com>
- To: Gary Benson <gbenson at redhat dot com>
- Cc: gdb-patches at sourceware dot org, CÃdric Buissart <cedric dot buissart at gmail dot com>
- Date: Thu, 02 Jul 2015 12:38:51 +0100
- Subject: Re: [PATCH 1/5] Introduce build_debug_file_name
- Authentication-results: sourceware.org; auth=none
- References: <1434447768-17328-1-git-send-email-gbenson at redhat dot com> <1434447768-17328-2-git-send-email-gbenson at redhat dot com> <5593C985 dot 7020204 at redhat dot com> <20150702111821 dot GA17978 at blade dot nx>
On 07/02/2015 12:18 PM, Gary Benson wrote:
> Pedro Alves wrote:
>> On 06/16/2015 10:42 AM, Gary Benson wrote:
>>> This commit introduces a new function build_debug_file_name which
>>> concatenates a series of filename components into a filename.
>>> find_separate_debug_file is updated to use build_debug_file_name.
>>> A later commit in this series will extend build_debug_file_name to
>>> correctly handle "target:" prefixes, so it is convenient to have
>>> filename building pulled out into one function. For now the only
>>> functional change here is that the original code sometimes
>>> generated filenames with repeated directory separators while the
>>> new code does not.
>>
>> I'd drop the "debug" from the function's name. Sounds like a
>> candidate for reuse elsewhere to me.
>
> Should I put it somewhere else, maybe common-utils.c?
I dislike common-utils.c for "kitchen-sink" reasons, though.
There's common/filestuff.c, but that looks more for low/OS level
file things.
There's substitute_path_component (and gdb_realpath / gdb_abspath)
in utils.c. Maybe put it next to substitute_path_component, which
seems to be in the same "family" of function, and then (at some point)
we would move all file name/path manipulation routines to its own file.
WDYT?
Thanks,
Pedro Alves