Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi via Gdb-patches <gdb-patches@sourceware.org>
To: Andrew Burgess <andrew.burgess@embecosm.com>,
	Lancelot SIX <lsix@lancelotsix.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] Improve gdb_tilde_expand logic
Date: Fri, 8 Jan 2021 10:59:05 -0500	[thread overview]
Message-ID: <58a88de1-6c5d-98ec-62d2-860f9ad7a8a8@polymtl.ca> (raw)
In-Reply-To: <20210108093058.GR2945@embecosm.com>

On 2021-01-08 4:30 a.m., Andrew Burgess wrote:
> There's only very limited unit testing within GDB.  You should write a
> test in gdb/testsuite/.... that triggers this behaviour and check the
> functionality that way.

It might be difficult to write a .exp test that specifically targets this
function... I think a selftest for this could be useful (in addition to
something in a .exp file, if this ends up used for the index-cache
directory, as discussed).

The selftest could just call gdb_tilde_expand with
"~/a/non/existent/directory" and make some simple assertions with the
result.  That selftest could probably be written directly in
gdbsupport/gdb_tilde_expand.cc.  That would be the first time a
selftest is put in a gdbsupport file, but I don't think that will
cause a problem.  That test will be available in both GDB and GDBserver.

You can check the test for gdb_realpath in gdb/utils.c if you want
an example.

Simon

  reply	other threads:[~2021-01-08 16:00 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-08  0:13 Lancelot SIX via Gdb-patches
2021-01-08  9:30 ` Andrew Burgess
2021-01-08 15:59   ` Simon Marchi via Gdb-patches [this message]
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
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=58a88de1-6c5d-98ec-62d2-860f9ad7a8a8@polymtl.ca \
    --to=gdb-patches@sourceware.org \
    --cc=andrew.burgess@embecosm.com \
    --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