From: Tom Tromey <tom@tromey.com>
To: Andrew Burgess <aburgess@redhat.com>
Cc: gdb-patches@sourceware.org, Lancelot SIX <lsix@lancelotsix.com>
Subject: Re: [PATCH] gdb: add trailing '/' when using 'complete' with directory names
Date: Wed, 10 Jan 2024 11:50:05 -0700 [thread overview]
Message-ID: <871qaprpk2.fsf@tromey.com> (raw)
In-Reply-To: <201ea779c61975868a6fe54b8832dd9b1296201e.1704302373.git.aburgess@redhat.com> (Andrew Burgess's message of "Wed, 3 Jan 2024 17:20:07 +0000")
>>>>> "Andrew" == Andrew Burgess <aburgess@redhat.com> writes:
Andrew> This patch contains work pulled from this previously proposed patch:
Andrew> https://inbox.sourceware.org/gdb-patches/20210213220752.32581-2-lsix@lancelotsix.com/
Andrew> But has been modified by me. Credit for the original idea and
Andrew> implementation goes to Lancelot, any bugs in this new iteration belong
Andrew> to me.
Thanks for doing this.
Andrew> (gdb) complete file /tmp/f
Andrew> file /tmp/foo
This is:
https://sourceware.org/bugzilla/show_bug.cgi?id=16265
Andrew> + gdb::unique_xmalloc_ptr<char> tmp
Andrew> + (static_cast<char *> (xmalloc (strlen (p_rl.get ()) + 2)));
Andrew> + char *next = stpcpy (tmp.get (), p_rl.get ());
Andrew> + strcpy (next, "/");
Andrew> + p_rl = std::move (tmp);
Personally I'd just use 'concat' here.
Andrew> - completion_tracker ();
Andrew> + completion_tracker (bool from_readline);
I stick 'explicit' on these out of habit.
Andrew> + /* Tells if the completion task is triggered by readline.
Andrew> + See m_from_readline. */
Andrew> + const bool &from_readline () const
Returning a reference here seems weird.
Other than these little nits it looks fine to me.
Tom
prev parent reply other threads:[~2024-01-10 18:50 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-03 17:20 Andrew Burgess
2024-01-03 20:16 ` John Baldwin
2024-01-04 12:12 ` [PATCHv2] " Andrew Burgess
2024-01-11 16:02 ` [PATCHv3] " Andrew Burgess
2024-01-11 17:18 ` Tom Tromey
2024-01-12 11:05 ` Andrew Burgess
2024-01-11 19:25 ` John Baldwin
2024-01-10 18:50 ` Tom Tromey [this message]
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=871qaprpk2.fsf@tromey.com \
--to=tom@tromey.com \
--cc=aburgess@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=lsix@lancelotsix.com \
/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).