From: Simon Marchi <simark@simark.ca>
To: Philippe Waroquiers <philippe.waroquiers@skynet.be>,
gdb-patches@sourceware.org
Subject: Re: [PATCH] Fix double apropos output when both alias name and command name match the pattern
Date: Wed, 12 Aug 2026 16:24:47 -0400 [thread overview]
Message-ID: <d981fcb6-4077-4129-b585-26e452aac7b1@simark.ca> (raw)
In-Reply-To: <20260531163756.781643-2-philippe.waroquiers@skynet.be>
On 5/31/26 12:37 PM, Philippe Waroquiers wrote:
> diff --git a/gdb/testsuite/gdb.base/help.exp b/gdb/testsuite/gdb.base/help.exp
> index a8c55721ef2..6a88c8d4db2 100644
> --- a/gdb/testsuite/gdb.base/help.exp
> +++ b/gdb/testsuite/gdb.base/help.exp
> @@ -135,6 +135,14 @@ gdb_test_no_output "alias mybt10 = backtrace 10" "define mybt10 alias"
> gdb_test "apropos Print backtrace of all stack frames, or innermost COUNT frames\." \
> "backtrace, mybt10, mybt, where, bt -- Print backtrace of all stack frames, or innermost COUNT frames\.\[\r\n\]+ alias mybt10 = backtrace 10"
>
> +# Test apropos when both the alias name and the aliased command match the pattern.
> +gdb_test_no_output "alias ter-exec = interpreter-exec" "define ter-exec alias"
> +gdb_test_multiple "apropos er-exe" "check we have a single output line when alias and command name match" {
> + -re "^apropos er-exe\r\ninterpreter-exec, ter-exec -- Execute a command in an interpreter\.\r\n$gdb_prompt $" {
> + pass $gdb_test_name
> + }
Is there a reason why you can't use gdb_test here?
With an unpatched gdb, we get the bug with "backtrace":
(gdb) apropos backtrace
...
backtrace, where, bt -- Print backtrace of all stack frames, or innermost COUNT frames.
backtrace, where, bt -- Print backtrace of all stack frames, or innermost COUNT frames.
...
You could perhaps add a test using the backtrace command as well?
In any case:
Approved-By: Simon Marchi <simon.marchi@efficios.com>
Simon
prev parent reply other threads:[~2026-08-12 20:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-31 16:37 Philippe Waroquiers
2026-05-31 16:37 ` [PATCH] " Philippe Waroquiers
2026-06-16 18:51 ` Philippe Waroquiers
2026-07-21 14:42 ` Philippe Waroquiers
2026-07-23 14:59 ` Guinevere Larsen
2026-08-12 20:24 ` Simon Marchi [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=d981fcb6-4077-4129-b585-26e452aac7b1@simark.ca \
--to=simark@simark.ca \
--cc=gdb-patches@sourceware.org \
--cc=philippe.waroquiers@skynet.be \
/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