From: Simon Marchi via Gdb-patches <gdb-patches@sourceware.org>
To: Lancelot SIX <lsix@lancelotsix.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH v4] Improve gdb_tilde_expand logic
Date: Mon, 11 Jan 2021 18:36:32 -0500 [thread overview]
Message-ID: <1d949257-45d9-d629-94db-5a6b5161ad59@polymtl.ca> (raw)
In-Reply-To: <20210111224059.32287-1-lsix@lancelotsix.com>
On 2021-01-11 5:40 p.m., Lancelot SIX via Gdb-patches wrote:
> Before this patch, gdb_tilde_expand would use glob(3) in order to expand
> tilde at the begining of a path. This implementation has limitation when
> expanding a tilde leading path to a non existing file since glob fails to
> expand.
>
> This patch proposes to use glob only to expand the tilde component of the
> path and leaves the rest of the path unchanged.
>
> This patch is a followup to the following discution:
> https://sourceware.org/pipermail/gdb-patches/2021-January/174776.html
>
> Before the patch:
>
> gdb_tilde_expand("~") -> "/home/lsix"
> gdb_tilde_expand("~/a/c/b") -> error() is called
>
> After the patch:
>
> gdb_tilde_expand("~") -> "/home/lsix"
> gdb_tilde_expand("~/a/c/b") -> "/home/lsix/a/c/b"
>
> Tested on x84_64 linux.
>
> Since V1:
> * Unittests added thanks to inputs and skeleton provided by
> Simon Marchi.
> * My copyright assignment has been signed!
>
> Since V2:
> * Fix coding style issuess and typos.
> * Use $HOME and $USER env variables to test the behavior of
> gdb_tilde_expand instead of testing the function against itself.
>
> Since V3:
> * Add tests for erroneous cases.
> * Fix coding style of lambda function.
>
> gdb/ChangeLog:
>
> * Makefile.in (SELFTESTS_SRCS): Add
> unittests/gdb_tilde_expand-selftests.c.
> * unittests/gdb_tilde_expand-selftests.c: New file.
>
> gdbsupport/ChangeLog:
>
> * gdb_tilde_expand.cc (gdb_tilde_expand): Improve
> implementation.
> (gdb_tilde_expand_up): Delegate logic to gdb_tilde_expand.
> * gdb_tilde_expand.h (gdb_tilde_expand): Update description.
This is ok. Did you get your sourceware account? Once you do, you can push
a commit to add yourself to gdb/MAINTAINERS (just look up previous commit that
touch this file for examples).
Simon
next prev parent reply other threads:[~2021-01-11 23:37 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-08 0:13 [PATCH] " Lancelot SIX via Gdb-patches
2021-01-08 9:30 ` Andrew Burgess
2021-01-08 15:59 ` Simon Marchi via Gdb-patches
2021-01-09 1:33 ` Lancelot SIX via Gdb-patches
2021-01-09 2:17 ` Simon Marchi via Gdb-patches
2021-01-09 18:29 ` [PATCH v2] " Lancelot SIX via Gdb-patches
2021-01-10 23:20 ` Sergio Durigan Junior via Gdb-patches
2021-01-11 0:23 ` Lancelot SIX via Gdb-patches
2021-01-11 1:00 ` [PATCH v3] " Lancelot SIX via Gdb-patches
2021-01-11 17:11 ` Simon Marchi via Gdb-patches
2021-01-11 22:40 ` [PATCH v4] " Lancelot SIX via Gdb-patches
2021-01-11 23:36 ` Simon Marchi via Gdb-patches [this message]
2021-01-14 23:04 ` Lancelot SIX via Gdb-patches
2021-01-23 17:40 ` Lancelot SIX via Gdb-patches
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=1d949257-45d9-d629-94db-5a6b5161ad59@polymtl.ca \
--to=gdb-patches@sourceware.org \
--cc=lsix@lancelotsix.com \
--cc=simon.marchi@polymtl.ca \
/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