From patchwork Fri Oct 12 20:33:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 29722 Received: (qmail 69117 invoked by alias); 12 Oct 2018 20:33:57 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 69100 invoked by uid 89); 12 Oct 2018 20:33:57 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3 autolearn=ham version=3.3.2 spammy=2190, H*RU:sk:sesbmg2, Hx-spam-relays-external:sk:sesbmg2, H*F:D*ericsson.com X-HELO: sesbmg23.ericsson.net Received: from sesbmg23.ericsson.net (HELO sesbmg23.ericsson.net) (193.180.251.37) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 12 Oct 2018 20:33:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; d=ericsson.com; s=mailgw201801; c=relaxed/simple; q=dns/txt; i=@ericsson.com; t=1539376433; x=1541968433; h=From:Sender:Reply-To:Subject:Date:Message-ID:To:CC:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=qUe5qmVy18vX9hrn7D1wdmcp2YQyd0ICjs43WC/7o5o=; b=W4x1V+cf7zfEexI0/5IgWZZMmeThDqZsvATJ2Ghq7JG7SrSN1Ix0R5fu1WBP0VJl OzrbtRiZmTF5rTzy9tIHElTTLHOsQMuYNJpBUjUrzD6iNNoJ+1nIBVatvYYIEDLe nIHTCadNXkdiUrTjA+njPMG1qrQEaS1QS4Xv6BWAmKY=; Received: from ESESBMB503.ericsson.se (Unknown_Domain [153.88.183.116]) by sesbmg23.ericsson.net (Symantec Mail Security) with SMTP id 7D.8E.06324.13501CB5; Fri, 12 Oct 2018 22:33:53 +0200 (CEST) Received: from ESESBMB503.ericsson.se (153.88.183.170) by ESESBMB503.ericsson.se (153.88.183.170) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Fri, 12 Oct 2018 22:33:52 +0200 Received: from NAM02-CY1-obe.outbound.protection.outlook.com (153.88.183.157) by ESESBMB503.ericsson.se (153.88.183.170) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3 via Frontend Transport; Fri, 12 Oct 2018 22:33:52 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericsson.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=00cOp6d4SaaatGkGIUIyTh2Iu3hoFjh/JsIGQLKy2iw=; b=f+XSfHylH5CSTySVTZ7WGCepBGh3VPGF6qjaPlVQRS8Z86+L4A+aR3HyuClqZqqYofVVRi2A2wl1jvGxD5Pc9YerY8OjkikGHCl1jVPJaDdOaF91diZ/W1CENoKCm+kFg6UnXdmjT5A94nqIKbeF8Znf1j3wPflSAmAXirdnIPg= Received: from BYAPR15MB2390.namprd15.prod.outlook.com (52.135.198.30) by BYAPR15MB2280.namprd15.prod.outlook.com (52.135.197.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1228.21; Fri, 12 Oct 2018 20:33:49 +0000 Received: from BYAPR15MB2390.namprd15.prod.outlook.com ([fe80::619e:2dbd:180c:a2fb]) by BYAPR15MB2390.namprd15.prod.outlook.com ([fe80::619e:2dbd:180c:a2fb%5]) with mapi id 15.20.1228.020; Fri, 12 Oct 2018 20:33:49 +0000 From: Simon Marchi To: "gdb-patches@sourceware.org" CC: Simon Marchi Subject: [pushed] Fix buglets in gdb.trace/tspeed.{exp,c} Date: Fri, 12 Oct 2018 20:33:49 +0000 Message-ID: <20181012203332.10833-1-simon.marchi@ericsson.com> authentication-results: spf=none (sender IP is ) smtp.mailfrom=simon.marchi@ericsson.com; received-spf: None (protection.outlook.com: ericsson.com does not designate permitted sender hosts) MIME-Version: 1.0 Return-Path: simon.marchi@ericsson.com X-IsSubscribed: yes When trying to run gdb.trace/tspeed.exp, I get: ERROR: can't read "ipalib": no such variable while executing "gdb_load_shlib $ipalib" (procedure "prepare_for_trace_test" line 5) This problem seems to come from commit c708f4d256f ("gdb: Don't call gdb_load_shlib unless GDB is running") which moved the gdb_load_shlib call in prepare_for_trace_test. In order to access the ipalib variable, we need to declare "global ipalib" first. Then, this test uses nowarnings, for no good reason I could find. We can remove that and fix the two trivial warnings that appear: /home/emaisin/src/binutils-gdb/gdb/testsuite/gdb.trace/tspeed.c: In function 'main': /home/emaisin/src/binutils-gdb/gdb/testsuite/gdb.trace/tspeed.c:87:16: warning: too many arguments for format [-Wformat-extra-args] printf ("Negative times, giving up\n", max_iters); ^ /home/emaisin/src/binutils-gdb/gdb/testsuite/gdb.trace/tspeed.c:99:7: warning: implicit declaration of function 'sleep' [-Wimplicit-function-declaration] sleep (1); /* set post-run breakpoint here */ ^ gdb/testsuite/ChangeLog: * gdb.trace/tspeed.exp: Remove nowarnings. (prepare_for_trace_test): Declare "global ipalib". * gdb.trace/tspeed.c: Include unistd.h. (main): Remove superfluous printf argument. --- gdb/testsuite/ChangeLog | 7 +++++++ gdb/testsuite/gdb.trace/tspeed.c | 3 ++- gdb/testsuite/gdb.trace/tspeed.exp | 3 ++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index ba5fae99e7d..465d606f0e5 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2018-10-12 Simon Marchi + + * gdb.trace/tspeed.exp: Remove nowarnings. + (prepare_for_trace_test): Declare "global ipalib". + * gdb.trace/tspeed.c: Include unistd.h. + (main): Remove superfluous printf argument. + 2018-10-11 Sandra Loosemore * gdb.base/solib-vanish.exp: Fix regexp not to require a POSIX diff --git a/gdb/testsuite/gdb.trace/tspeed.c b/gdb/testsuite/gdb.trace/tspeed.c index b084d6a5bbc..8995ebb23ef 100644 --- a/gdb/testsuite/gdb.trace/tspeed.c +++ b/gdb/testsuite/gdb.trace/tspeed.c @@ -28,6 +28,7 @@ #include #include #include +#include int trace_speed_test (void); @@ -84,7 +85,7 @@ main(int argc, char **argv) } if (problem < 0) { - printf ("Negative times, giving up\n", max_iters); + printf ("Negative times, giving up\n"); break; } diff --git a/gdb/testsuite/gdb.trace/tspeed.exp b/gdb/testsuite/gdb.trace/tspeed.exp index 47a82502a00..bc12afd0a83 100644 --- a/gdb/testsuite/gdb.trace/tspeed.exp +++ b/gdb/testsuite/gdb.trace/tspeed.exp @@ -21,7 +21,7 @@ set executable $testfile set ipalib [get_in_proc_agent] if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \ - executable [concat {debug nowarnings c} shlib=$ipalib]] != "" } { + executable [concat {debug c} shlib=$ipalib]] != "" } { untested "failed to compile" return -1 } @@ -38,6 +38,7 @@ set cr "\[\r\n\]+" proc prepare_for_trace_test {} { global executable + global ipalib clean_restart $executable gdb_load_shlib $ipalib