diff options
author | Lancelot SIX <lsix@lancelotsix.com> | 2021-01-11 22:40:59 +0000 |
---|---|---|
committer | Lancelot SIX <lsix@lancelotsix.com> | 2021-01-23 17:17:38 +0000 |
commit | d3ee35dbf754b72461f67a29892fff0d10961065 (patch) | |
tree | 5c7fe4009561e03320af100268f1afad55d467dd /gdb/ChangeLog | |
parent | ef45cb65a7be9f80686233d0e5586ced81613db0 (diff) | |
download | gdb-d3ee35dbf754b72461f67a29892fff0d10961065.zip gdb-d3ee35dbf754b72461f67a29892fff0d10961065.tar.gz gdb-d3ee35dbf754b72461f67a29892fff0d10961065.tar.bz2 |
Improve gdb_tilde_expand logic.
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.
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.
Diffstat (limited to 'gdb/ChangeLog')
-rw-r--r-- | gdb/ChangeLog | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index bbb00e4..bb18676 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2021-01-23 Lancelot SIX <lsix@lancelotsix.com> + + * Makefile.in (SELFTESTS_SRCS): Add + unittests/gdb_tilde_expand-selftests.c. + * unittests/gdb_tilde_expand-selftests.c: New file. + 2021-01-22 Andrew Burgess <andrew.burgess@embecosm.com> PR cli/25956 |