public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Weimin Pan <weimin.pan@oracle.com>
To: Andrew Burgess <andrew.burgess@embecosm.com>,
	       gdb-patches <gdb-patches@sourceware.org>
Cc: Simon Marchi <simark@simark.ca>
Subject: Re: [PATCH 0/2] CTF Testing Changes
Date: Tue, 08 Oct 2019 21:04:00 -0000	[thread overview]
Message-ID: <ba35bb5e-261f-2eef-b07c-a5aa9f80c721@oracle.com> (raw)
In-Reply-To: <cover.1570526677.git.andrew.burgess@embecosm.com>


On 10/8/2019 2:39 AM, Andrew Burgess wrote:
> I was taking a look through the CTF testing and I think the following
> patches would be a nice clean up.
>
> The first adds a `compiler_supports_ctf_debug` guard function, so we
> don't try to run the ctf test scripts when the compiler doesn't
> support ctf debug format.  This seems to be inline with how most of
> our other big features are guarded.
>
> My second thought was that the 4 CTF tests added are all pretty much
> copies of existing non-ctf tests.  I think these tests would be better
> done as variations of the original test scripts rather than making
> copies.  The second patch makes a start on this, deleting
> ctf-cvexpr.exp and extending cvexpr.exp to cover the same cases[1].
>
> The remaining 3 tests require a little more work as the original C
> files were changed slightly, so I've not addressed these yet, but will
> try to find time to look at these soon.
>
> A final note, and something I don't have an immediate plan to address,
> but Weimin might want to consider, is that we could do with a test for
> CTF that doesn't rely on having a CTF compiler around, even if it is
> just a very basic test.  It should be possible (I think) to create
> such a test by placing the raw CTF output into a .S file, and then
> linking against a .c file compiled without debug.  I think some of the
> tests in gdb.arch/ are done like this.

LGTM. Please note that currently the toolchain supports the ctf info for
a single compilation unit only and is expected to support multiple CU's
shortly. By which time, We may need to revisit these ctf tests and do
the necessary merging, like you did for gdb.base/ctf-cvexpr.exp and
gdb.base/cvexpr.exp, gdb.base/ctf-ptype.exp would be a good candidate
to merge with gdb.base/ptype.exp which uses more than one .c source file,
and add new tests with mixed ctf-dwarf info, for example, or linking a 
.S file
with raw ctf data againt a .c file compiled without debug as you suggested .

Thanks.

>
> [1] The original ctf-cvexpr.exp file didn't actually test ctf at all,
>      but just compiled with the standard -g compiler flag, resulting in
>      (probably) DWARF debug output.  I'm assuming this is a mistake,
>      which I've fixed in this patch.
>
> --
>
> Andrew Burgess (2):
>    gdb/testsuite: Introduce compiler_supports_ctf_debug guard function
>    gdb/testsuite: Merge cvexpr.exp and ctf-cvexpr.exp
>
>   gdb/testsuite/ChangeLog                  |  13 +
>   gdb/testsuite/gdb.base/ctf-constvars.exp |  20 +-
>   gdb/testsuite/gdb.base/ctf-cvexpr.exp    | 495 -------------------------------
>   gdb/testsuite/gdb.base/ctf-ptype.exp     |  10 +-
>   gdb/testsuite/gdb.base/ctf-whatis.exp    |  10 +-
>   gdb/testsuite/gdb.base/cvexpr.exp        | 466 +++++++++++++++--------------
>   gdb/testsuite/lib/gdb.exp                |  11 +
>   7 files changed, 287 insertions(+), 738 deletions(-)
>   delete mode 100644 gdb/testsuite/gdb.base/ctf-cvexpr.exp
>

      parent reply	other threads:[~2019-10-08 21:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-08  9:39 Andrew Burgess
2019-10-08  9:39 ` [PATCH 2/2] gdb/testsuite: Merge cvexpr.exp and ctf-cvexpr.exp Andrew Burgess
2019-10-08  9:39 ` [PATCH 1/2] gdb/testsuite: Introduce compiler_supports_ctf_debug guard function Andrew Burgess
2019-10-08 21:04 ` Weimin Pan [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=ba35bb5e-261f-2eef-b07c-a5aa9f80c721@oracle.com \
    --to=weimin.pan@oracle.com \
    --cc=andrew.burgess@embecosm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simark@simark.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).