Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@polymtl.ca>
To: Sandra Loosemore <sandra@codesourcery.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [patch, testsuite] Clean up gdb.trace results
Date: Fri, 12 Oct 2018 21:36:00 -0000	[thread overview]
Message-ID: <5a1969ab48b5e4bc6ba823a868fed83b@polymtl.ca> (raw)
In-Reply-To: <7bf12e32-9e47-3ff1-3092-303dfdff98ff@codesourcery.com>

On 2018-10-11 01:19, Sandra Loosemore wrote:
> If the architecture isn't one of those supported by trace-common.h,
> then actions.c (or any other program that includes trace-common.h)
> won't compile.  E.g. here is a recent gdb.sum extract for nios2-elf
> (using gdb 8.2 branch):
> 
> Running
> /scratch/sandra/nios2-elf-fall-preview/src/gdb-master-8.2/gdb/testsuite/gdb.trace/actions.exp
> ...
> gdb compile failed, In file included from
> /scratch/sandra/nios2-elf-fall-preview/src/gdb-master-8.2/gdb/testsuite/gdb.trace/actions.c:24:
> /scratch/sandra/nios2-elf-fall-preview/src/gdb-master-8.2/gdb/testsuite/gdb.trace/trace-common.h:61:2:
> error: #error "unsupported architecture for trace tests"
>  #error "unsupported architecture for trace tests"
>   ^~~~~
> /scratch/sandra/nios2-elf-fall-preview/src/gdb-master-8.2/gdb/testsuite/gdb.trace/actions.c:
> In function 'main':
> /scratch/sandra/nios2-elf-fall-preview/src/gdb-master-8.2/gdb/testsuite/gdb.trace/actions.c:146:26:
> error: 'fast_tracepoint_loc' undeclared (first use in this function)
>    FAST_TRACEPOINT_LABEL (fast_tracepoint_loc);
>                           ^~~~~~~~~~~~~~~~~~~
> /scratch/sandra/nios2-elf-fall-preview/src/gdb-master-8.2/gdb/testsuite/gdb.trace/actions.c:146:26:
> note: each undeclared identifier is reported only once for each
> function it appears in
> UNTESTED: gdb.trace/actions.exp: failed to compile
> 
> My patch does not change what targets the tests work on, it only makes
> it fail gracefully with UNSUPPORTED instead of spewing a bunch of
> compilation errors into the gdb.sum file and reporting UNTESTED.

Ah I see.  So to properly reproduce it (by faking it) on x86, I need to 
both make x86_supports_tracepoints return 0 and remove the x86-specific 
code in trace-common.h.  If I do that, I see that indeed, the output is 
not pretty (lots of compilation failures + untested).

> Well, the particular use case I've been looking at are nios2-linux-gnu
> and nios2-elf, and seeing my gdb.sum files full of random compilation
> errors and TCL ERRORs where I think it should just be reporting
> UNSUPPORTED.  Most of the compilation errors are coming from
> trace-common.h, and as I said, I'm under the impression that making
> this work involves adding target hooks to gdb and/or gdbserver and not
> just adding some stub for the arch to trace-common.h to prevent it
> from hitting the preprocessor #error and undefined symbol errors.  I'm
> really not even clear on the difference between "tracepoints" and
> "fast tracepoints" is, or which things which testcases are trying to
> test.
> 
> 
> IMO the problem here is that these tests were written with the
> assumption that the all support is present -- not just the tracepoint
> support, but things like shared libraries and signals that typically
> aren't supported on bare-metal targets, so they're just failing in
> really ugly ways when the necessary support isn't there.

That's true, and I'd say many tests are gdbserver-specific, since they 
load the in-process agent library.  If somebody has a different gdb stub 
implementation that supports tracepoints, that would be a good candidate 
to clean up the testsuite further, making sure we only run 
gdbserver-specific tests when testing against the actual gdbserver.

I have compared runs with/without your patch on x86 with the unix 
(default) and native-gdbserver boards, the results did not change. I 
then compared before/after runs using these boards but also mocking that 
tracepoints are not supported on x86, and the output is now much better. 
  So the patch LGTM, thanks!

Simon


      reply	other threads:[~2018-10-12 21:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-07  1:09 Sandra Loosemore
2018-10-08  2:25 ` Simon Marchi
2018-10-11  2:01   ` Sandra Loosemore
2018-10-11  4:08     ` Simon Marchi
2018-10-11  5:19       ` Sandra Loosemore
2018-10-12 21:36         ` 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=5a1969ab48b5e4bc6ba823a868fed83b@polymtl.ca \
    --to=simon.marchi@polymtl.ca \
    --cc=gdb-patches@sourceware.org \
    --cc=sandra@codesourcery.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