public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Running selftests in GDB
@ 2020-09-28  9:33 Eli Zaretskii
  2020-09-28 16:53 ` Eli Zaretskii
  0 siblings, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2020-09-28  9:33 UTC (permalink / raw)
  To: gdb

By default, GDB built from a release tarball doesn't include the
selftest.  I've configured GDB with --enable-unit-tests, and then some
selftests are available.  But not all: a development version runs 63
unit tests, whereas the release version configured with unit tests
runs only 24.

How do I enable all the selftests that are available in the
development build?

TIA

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Running selftests in GDB
  2020-09-28  9:33 Running selftests in GDB Eli Zaretskii
@ 2020-09-28 16:53 ` Eli Zaretskii
  2020-10-04 15:52   ` Maciej W. Rozycki
  0 siblings, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2020-09-28 16:53 UTC (permalink / raw)
  To: gdb

> Date: Mon, 28 Sep 2020 12:33:36 +0300
> From: Eli Zaretskii via Gdb <gdb@sourceware.org>
> 
> By default, GDB built from a release tarball doesn't include the
> selftest.  I've configured GDB with --enable-unit-tests, and then some
> selftests are available.  But not all: a development version runs 63
> unit tests, whereas the release version configured with unit tests
> runs only 24.
> 
> How do I enable all the selftests that are available in the
> development build?

Answering myself: after reconfiguring with --enable-unit-tests, one
should make sure gdb/init.c is regenerated.  It looks like it won't be
regenerated, unless you touch one of the source files mentioned in
COMMON_SFILES by gdb/Makefile.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Running selftests in GDB
  2020-09-28 16:53 ` Eli Zaretskii
@ 2020-10-04 15:52   ` Maciej W. Rozycki
  2020-10-04 16:18     ` Eli Zaretskii
  0 siblings, 1 reply; 6+ messages in thread
From: Maciej W. Rozycki @ 2020-10-04 15:52 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: gdb

On Mon, 28 Sep 2020, Eli Zaretskii via Gdb wrote:

> > By default, GDB built from a release tarball doesn't include the
> > selftest.  I've configured GDB with --enable-unit-tests, and then some
> > selftests are available.  But not all: a development version runs 63
> > unit tests, whereas the release version configured with unit tests
> > runs only 24.
> > 
> > How do I enable all the selftests that are available in the
> > development build?
> 
> Answering myself: after reconfiguring with --enable-unit-tests, one
> should make sure gdb/init.c is regenerated.  It looks like it won't be
> regenerated, unless you touch one of the source files mentioned in
> COMMON_SFILES by gdb/Makefile.

 It looks like a dependency needs to be added to gdb/Makefile.in for 
gdb/init.c on whatever is changed with `--enable-unit-tests' that affects 
the file; can you run a diff on the object tree configured with and 
without the option to figure out what has changed that affects gdb/init.c?

  Maciej

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Running selftests in GDB
  2020-10-04 15:52   ` Maciej W. Rozycki
@ 2020-10-04 16:18     ` Eli Zaretskii
  2020-10-04 17:56       ` Maciej W. Rozycki
  0 siblings, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2020-10-04 16:18 UTC (permalink / raw)
  To: Maciej W. Rozycki; +Cc: gdb

> Date: Sun, 4 Oct 2020 16:52:29 +0100 (BST)
> From: "Maciej W. Rozycki" <macro@linux-mips.org>
> cc: gdb@sourceware.org
> 
> > Answering myself: after reconfiguring with --enable-unit-tests, one
> > should make sure gdb/init.c is regenerated.  It looks like it won't be
> > regenerated, unless you touch one of the source files mentioned in
> > COMMON_SFILES by gdb/Makefile.
> 
>  It looks like a dependency needs to be added to gdb/Makefile.in for 
> gdb/init.c on whatever is changed with `--enable-unit-tests' that affects 
> the file; can you run a diff on the object tree configured with and 
> without the option to figure out what has changed that affects gdb/init.c?

AFAIR, the object tree didn't change, but SELFTESTS_OBS don't appear
in CONFIG_OBS.  When you reconfigure, SELFTESTS_OBS gets added to
CONFIG_OBS, but there's nothing to trigger init.c regeneration.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Running selftests in GDB
  2020-10-04 16:18     ` Eli Zaretskii
@ 2020-10-04 17:56       ` Maciej W. Rozycki
  2020-10-04 18:27         ` Eli Zaretskii
  0 siblings, 1 reply; 6+ messages in thread
From: Maciej W. Rozycki @ 2020-10-04 17:56 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: gdb

On Sun, 4 Oct 2020, Eli Zaretskii wrote:

> > > Answering myself: after reconfiguring with --enable-unit-tests, one
> > > should make sure gdb/init.c is regenerated.  It looks like it won't be
> > > regenerated, unless you touch one of the source files mentioned in
> > > COMMON_SFILES by gdb/Makefile.
> > 
> >  It looks like a dependency needs to be added to gdb/Makefile.in for 
> > gdb/init.c on whatever is changed with `--enable-unit-tests' that affects 
> > the file; can you run a diff on the object tree configured with and 
> > without the option to figure out what has changed that affects gdb/init.c?
> 
> AFAIR, the object tree didn't change, but SELFTESTS_OBS don't appear
> in CONFIG_OBS.  When you reconfigure, SELFTESTS_OBS gets added to
> CONFIG_OBS, but there's nothing to trigger init.c regeneration.

 Well, it couldn't have been that the object tree didn't change then, as 
the addition of SELFTESTS_OBS to CONFIG_OBS is clearly a change. :)  It 
looks to me like gdb/Makefile should be a dependency of gdb/init.c then 
(or stamp-init really).

  Maciej

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Running selftests in GDB
  2020-10-04 17:56       ` Maciej W. Rozycki
@ 2020-10-04 18:27         ` Eli Zaretskii
  0 siblings, 0 replies; 6+ messages in thread
From: Eli Zaretskii @ 2020-10-04 18:27 UTC (permalink / raw)
  To: Maciej W. Rozycki; +Cc: gdb

> Date: Sun, 4 Oct 2020 18:56:06 +0100 (BST)
> From: "Maciej W. Rozycki" <macro@linux-mips.org>
> cc: gdb@sourceware.org
> 
> It looks to me like gdb/Makefile should be a dependency of
> gdb/init.c then (or stamp-init really).

I think you are right.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-10-04 18:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-28  9:33 Running selftests in GDB Eli Zaretskii
2020-09-28 16:53 ` Eli Zaretskii
2020-10-04 15:52   ` Maciej W. Rozycki
2020-10-04 16:18     ` Eli Zaretskii
2020-10-04 17:56       ` Maciej W. Rozycki
2020-10-04 18:27         ` Eli Zaretskii

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).