Message ID | 20200207150003.8383-6-shahab.vahedi@gmail.com |
---|---|
State | New, archived |
Headers |
Received: (qmail 81965 invoked by alias); 7 Feb 2020 15:01:10 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: <gdb-patches.sourceware.org> List-Unsubscribe: <mailto:gdb-patches-unsubscribe-##L=##H@sourceware.org> List-Subscribe: <mailto:gdb-patches-subscribe@sourceware.org> List-Archive: <http://sourceware.org/ml/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-help@sourceware.org>, <http://sourceware.org/ml/#faqs> Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 81342 invoked by uid 89); 7 Feb 2020 15:00:51 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=HContent-Transfer-Encoding:8bit X-HELO: mail-lj1-f193.google.com Received: from mail-lj1-f193.google.com (HELO mail-lj1-f193.google.com) (209.85.208.193) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 07 Feb 2020 15:00:49 +0000 Received: by mail-lj1-f193.google.com with SMTP id v17so2481180ljg.4 for <gdb-patches@sourceware.org>; Fri, 07 Feb 2020 07:00:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gb/QMUhS5WrEEaVVqcAyVyJWKA6Dr4bEiB0Vc+bi6yg=; b=kVGFU660jkhrM7gkw3yYdndhzw1glvgYl+FuHYB/C9llLvRuZ/m5oXQBgMl+b3xYO8 /Y9gNlvJRahUD3gqPaq/qPbyzoKi9XxAwrrGYEeTpW6/go5nVVcM6ZL4ourC8XmnlyWJ TRwMVvL5gNg1sB+vM2rGg1F7hDfx9j/hofLiqvAj5OPEsVLPBXwLCYPpEk0E6LRHPfOq OHdvI3/vtKqOvDJKX6CbW0mo63FnhpSnroOMRZObEs1cK7uHyQuIgJcSxU0vlNE9K2+y aID/FXo7+IBgT/QlIOnKQiQ21dKKhq499D71UUn/FUpJmEF1CbxqEqZEpFowihoupyjj o7VA== Return-Path: <shahab.vahedi@gmail.com> Received: from archie.internal.synopsys.com ([2a03:1b20:6:f011::2d]) by smtp.gmail.com with ESMTPSA id p136sm1184412lfa.8.2020.02.07.07.00.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Feb 2020 07:00:45 -0800 (PST) From: Shahab Vahedi <shahab.vahedi@gmail.com> To: gdb-patches@sourceware.org Cc: Shahab Vahedi <shahab@synopsys.com>, Shahab Vahedi <shahab.vahedi@gmail.com>, Francois Bedard <fbedard@synopsys.com>, Anton Kolesov <Anton.Kolesov@synopsys.com> Subject: [PATCH 05/14] gdb/testsuite: Skip a few gdb.base/skip.exp tests for remote targets Date: Fri, 7 Feb 2020 15:59:54 +0100 Message-Id: <20200207150003.8383-6-shahab.vahedi@gmail.com> In-Reply-To: <20200207150003.8383-1-shahab.vahedi@gmail.com> References: <20200207150003.8383-1-shahab.vahedi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit |
Commit Message
Shahab Vahedi
Feb. 7, 2020, 2:59 p.m. UTC
From: Anton Kolesov <Anton.Kolesov@synopsys.com> Few initial tests in gdb.base/skip.exp expect GDB to be in the state where there is no default file for "skip" command. This is true when debugging native targets - there is no inferior until "run" command is executed and thus there is no "default" skip file. However that is not true for remote targets - after "prepare_for_testing" test procedure GDB is already connected to the target and has an existing inferior, so "default" file is set by that time. gdb/testsuite/ChangeLog: 2016-07-13 Anton Kolesov <Anton.Kolesov@synopsys.com> * gdb.base/skip.exp: Skip a few tests if remotely connected. Signed-off-by: Anton Kolesov <Anton.Kolesov@synopsys.com> --- gdb/testsuite/gdb.base/skip.exp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
Comments
On 2/7/20 11:59 AM, Shahab Vahedi wrote: > From: Anton Kolesov <Anton.Kolesov@synopsys.com> > > Few initial tests in gdb.base/skip.exp expect GDB to be in the state where > there is no default file for "skip" command. This is true when debugging > native targets - there is no inferior until "run" command is executed and > thus there is no "default" skip file. However that is not true for remote > targets - after "prepare_for_testing" test procedure GDB is already > connected to the target and has an existing inferior, so "default" file is > set by that time. This is not what i see with a standard remote gdbserver-based test. For board "native-gdbserver" i see all the tests passing just fine. GDB gets fired up and these first few checks get done without connecting to gdbserver. Then GDB proceeds to connect to gdbserver. This, again, seems to indicate there is some custom board file in your setup that is implementing testsuite primitives (that prepare_for_testing calls) differently than what is present in GDB's testsuite. Am i missing something? I think this is also the case with 12/14. > > gdb/testsuite/ChangeLog: > 2016-07-13 Anton Kolesov <Anton.Kolesov@synopsys.com> > > * gdb.base/skip.exp: Skip a few tests if remotely connected. > > Signed-off-by: Anton Kolesov <Anton.Kolesov@synopsys.com> > --- > gdb/testsuite/gdb.base/skip.exp | 12 ++++++++---- > 1 file changed, 8 insertions(+), 4 deletions(-) > > diff --git a/gdb/testsuite/gdb.base/skip.exp b/gdb/testsuite/gdb.base/skip.exp > index 513c9fcc82ea..31a20c868a2a 100644 > --- a/gdb/testsuite/gdb.base/skip.exp > +++ b/gdb/testsuite/gdb.base/skip.exp > @@ -30,10 +30,14 @@ set srcfile skip.c > set srcfile1 skip1.c > > # Right after we start gdb, there's no default file or function to skip. > - > -gdb_test "skip file" "No default file now." "skip file (no default file)" > -gdb_test "skip function" "No default function now." > -gdb_test "skip" "No default function now." "skip (no default function)" > +# However that is not true for remote targets - after "prepare_for_testing" GDB > +# is already connected to the target and has a valid inferior, hence default > +# file. > +if ![use_gdb_stub] { > + gdb_test "skip file" "No default file now." "skip file (no default file)" > + gdb_test "skip function" "No default function now." > + gdb_test "skip" "No default function now." "skip (no default function)" > +} > > # Test elided args. > >
On 2/11/20 9:20 AM, Luis Machado wrote: > On 2/7/20 11:59 AM, Shahab Vahedi wrote: >> From: Anton Kolesov <Anton.Kolesov@synopsys.com> >> >> Few initial tests in gdb.base/skip.exp expect GDB to be in the state where >> there is no default file for "skip" command. This is true when debugging >> native targets - there is no inferior until "run" command is executed and >> thus there is no "default" skip file. However that is not true for remote >> targets - after "prepare_for_testing" test procedure GDB is already >> connected to the target and has an existing inferior, so "default" file is >> set by that time. > > This is not what i see with a standard remote gdbserver-based test. For board "native-gdbserver" i see all the tests passing just fine. > > GDB gets fired up and these first few checks get done without connecting to gdbserver. Then GDB proceeds to connect to gdbserver. > > This, again, seems to indicate there is some custom board file in your setup that is implementing testsuite primitives (that prepare_for_testing calls) differently than what is present in GDB's testsuite. > > Am i missing something? Anton, could you share your experience with us? > > I think this is also the case with 12/14. >> >> gdb/testsuite/ChangeLog: >> 2016-07-13 Anton Kolesov <Anton.Kolesov@synopsys.com> >> >> * gdb.base/skip.exp: Skip a few tests if remotely connected. >> >> Signed-off-by: Anton Kolesov <Anton.Kolesov@synopsys.com> >> --- >> gdb/testsuite/gdb.base/skip.exp | 12 ++++++++---- >> 1 file changed, 8 insertions(+), 4 deletions(-) >> >> diff --git a/gdb/testsuite/gdb.base/skip.exp b/gdb/testsuite/gdb.base/skip.exp >> index 513c9fcc82ea..31a20c868a2a 100644 >> --- a/gdb/testsuite/gdb.base/skip.exp >> +++ b/gdb/testsuite/gdb.base/skip.exp >> @@ -30,10 +30,14 @@ set srcfile skip.c >> set srcfile1 skip1.c >> # Right after we start gdb, there's no default file or function to skip. >> - >> -gdb_test "skip file" "No default file now." "skip file (no default file)" >> -gdb_test "skip function" "No default function now." >> -gdb_test "skip" "No default function now." "skip (no default function)" >> +# However that is not true for remote targets - after "prepare_for_testing" GDB >> +# is already connected to the target and has a valid inferior, hence default >> +# file. >> +if ![use_gdb_stub] { >> + gdb_test "skip file" "No default file now." "skip file (no default file)" >> + gdb_test "skip function" "No default function now." >> + gdb_test "skip" "No default function now." "skip (no default function)" >> +} >> # Test elided args. >>
> > > > This is not what i see with a standard remote gdbserver-based test. For board > "native-gdbserver" i see all the tests passing just fine. > > > > GDB gets fired up and these first few checks get done without connecting to > gdbserver. Then GDB proceeds to connect to gdbserver. > > > > This, again, seems to indicate there is some custom board file in your setup > that is implementing testsuite primitives (that prepare_for_testing calls) > differently than what is present in GDB's testsuite. > > > > Am i missing something? > > Anton, could you share your experience with us? > I don't remember the details, but if I read that correctly, the fix assumes that checks are done after connecting to the target. Perhaps the behavior has changed since the patch has been authored? We do use custom board, but I don't think it modifies test procedures like prepare_for_testing. It does however implement board specific open, close, and reboot procs, and for one server we implement custom gdb_comm_leave proc to ensure that each test is run with a new GDB instance, because GDB-instance reuse was causing troubles in some cases: https://github.com/foss-for-synopsys-dwc-arc-processors/toolchain/blob/arc-releases/dejagnu/nsim-extra.exp#L121
* Anton Kolesov <Anton.Kolesov@synopsys.com> [2020-02-25 08:39:16 +0000]: > > > > > > This is not what i see with a standard remote gdbserver-based test. For board > > "native-gdbserver" i see all the tests passing just fine. > > > > > > GDB gets fired up and these first few checks get done without connecting to > > gdbserver. Then GDB proceeds to connect to gdbserver. > > > > > > This, again, seems to indicate there is some custom board file in your setup > > that is implementing testsuite primitives (that prepare_for_testing calls) > > differently than what is present in GDB's testsuite. > > > > > > Am i missing something? > > > > Anton, could you share your experience with us? > > > > I don't remember the details, but if I read that correctly, the fix assumes > that checks are done after connecting to the target. Perhaps the behavior has > changed since the patch has been authored? We do use custom board, but I > don't think it modifies test procedures like prepare_for_testing. It does > however implement board specific open, close, and reboot procs, and for one > server we implement custom gdb_comm_leave proc to ensure that each test is run > with a new GDB instance, because GDB-instance reuse was causing troubles in > some cases: > https://github.com/foss-for-synopsys-dwc-arc-processors/toolchain/blob/arc-releases/dejagnu/nsim-extra.exp#L121 I'd be interested to know where you're doing the connect to a remote type logic that it's getting triggered from 'prepare_for_testing'. My first instinct is to say that's being done in the wrong place, but maybe there's a really good reason (TM), but I don't think we should modify this test until we understand what the reasoning is here. Thanks, Andrew
diff --git a/gdb/testsuite/gdb.base/skip.exp b/gdb/testsuite/gdb.base/skip.exp index 513c9fcc82ea..31a20c868a2a 100644 --- a/gdb/testsuite/gdb.base/skip.exp +++ b/gdb/testsuite/gdb.base/skip.exp @@ -30,10 +30,14 @@ set srcfile skip.c set srcfile1 skip1.c # Right after we start gdb, there's no default file or function to skip. - -gdb_test "skip file" "No default file now." "skip file (no default file)" -gdb_test "skip function" "No default function now." -gdb_test "skip" "No default function now." "skip (no default function)" +# However that is not true for remote targets - after "prepare_for_testing" GDB +# is already connected to the target and has a valid inferior, hence default +# file. +if ![use_gdb_stub] { + gdb_test "skip file" "No default file now." "skip file (no default file)" + gdb_test "skip function" "No default function now." + gdb_test "skip" "No default function now." "skip (no default function)" +} # Test elided args.