From: Simon Marchi <simark@simark.ca>
To: John Baldwin <jhb@freebsd.org>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH v2 2/4] Add a new function child_path.
Date: Tue, 12 Feb 2019 16:56:00 -0000 [thread overview]
Message-ID: <5ebc5be144593f836cc2a06b021be35d@simark.ca> (raw)
In-Reply-To: <19c13b48-63d4-581e-76f4-96b7dd3cd158@FreeBSD.org>
On 2019-02-12 11:52, John Baldwin wrote:
> On 2/11/19 6:46 PM, Simon Marchi wrote:
>> On 2019-02-11 9:43 p.m., Simon Marchi wrote:
>>> On 2019-01-28 3:47 p.m., John Baldwin wrote:
>>>> child_path returns a pointer to the first component in a child path
>>>> that comes after a parent path. This does not depend on trying to
>>>> stat() the paths since they may describe remote paths but instead
>>>> relies on filename parsing. The function requires that the child
>>>> path
>>>> describe a filename that contains at least one component below the
>>>> parent path and returns a pointer to the first component.
>>>>
>>>> gdb/ChangeLog:
>>>>
>>>> * Makefile.in (SUBDIR_UNITTESTS_SRCS): Add
>>>> unittests/child-path-selftests.c.
>>>> * common/pathstuff.c (child_path): New function.
>>>> * common/pathstuff.h (child_path): New prototype.
>>>> * unittests/child-path-selftests.c: New file.
>>>
>>> Thanks, this LGTM. Just minor comments below.
>>
>> Oh, and maybe name the function is_child_path or child_path_p?
>
> I started with that name in an earlier version when it returned a
> boolean,
> but renamed it when I found that I needed it to return the trailing
> portion
> of the child pathname to avoid duplicating logic in the caller. Maybe
> "get_child_path" would be better?
Ah you're right, it doesn't make sense if the function doesn't return a
bool. What you have is fine with me.
Simon
next prev parent reply other threads:[~2019-02-12 16:56 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-28 20:47 [PATCH v2 0/4] Some fixes for debug files and sysroots John Baldwin
2019-01-28 20:47 ` [PATCH v2 2/4] Add a new function child_path John Baldwin
2019-02-12 2:43 ` Simon Marchi
2019-02-12 2:46 ` Simon Marchi
2019-02-12 16:52 ` John Baldwin
2019-02-12 16:56 ` Simon Marchi [this message]
2019-01-28 20:47 ` [PATCH v2 3/4] Use child_path to determine if an object file is under a sysroot John Baldwin
2019-01-28 20:47 ` [PATCH v2 1/4] Look for separate debug files in debug directories " John Baldwin
2019-01-28 20:53 ` [PATCH v2 4/4] Try to use the canonical version of a sysroot for debug file links John Baldwin
2019-02-11 17:54 ` [PING] [PATCH v2 0/4] Some fixes for debug files and sysroots John Baldwin
2019-02-12 2:53 ` Simon Marchi
2019-02-12 21:59 ` John Baldwin
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=5ebc5be144593f836cc2a06b021be35d@simark.ca \
--to=simark@simark.ca \
--cc=gdb-patches@sourceware.org \
--cc=jhb@freebsd.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).