From patchwork Thu Dec 7 22:42:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 24790 Received: (qmail 68799 invoked by alias); 7 Dec 2017 22:42:47 -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 68783 invoked by uid 89); 7 Dec 2017 22:42:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.2 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= X-HELO: sessmg22.ericsson.net Received: from sessmg22.ericsson.net (HELO sessmg22.ericsson.net) (193.180.251.58) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 07 Dec 2017 22:42:44 +0000 Received: from ESESSHC019.ericsson.se (Unknown_Domain [153.88.183.75]) by sessmg22.ericsson.net (Symantec Mail Security) with SMTP id 12.31.13624.2E3C92A5; Thu, 7 Dec 2017 23:42:42 +0100 (CET) Received: from EUR02-VE1-obe.outbound.protection.outlook.com (153.88.183.145) by oa.msg.ericsson.com (153.88.183.75) with Microsoft SMTP Server (TLS) id 14.3.352.0; Thu, 7 Dec 2017 23:42:41 +0100 Received: from elxacz23q12.ericsson.se (129.192.64.65) by AM3PR07MB306.eurprd07.prod.outlook.com (2a01:111:e400:881b::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.323.4; Thu, 7 Dec 2017 22:42:39 +0000 From: Simon Marchi To: CC: Simon Marchi Subject: [pushed] Fix wrong prefix in py-breakpoint.exp Date: Thu, 7 Dec 2017 17:42:28 -0500 Message-ID: <1512686548-30968-1-git-send-email-simon.marchi@ericsson.com> MIME-Version: 1.0 X-ClientProxiedBy: BN6PR19CA0090.namprd19.prod.outlook.com (2603:10b6:404:133::28) To AM3PR07MB306.eurprd07.prod.outlook.com (2a01:111:e400:881b::14) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2e254453-72d2-46b7-5bc8-08d53dc3d2a6 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307); SRVR:AM3PR07MB306; X-Microsoft-Exchange-Diagnostics: 1; AM3PR07MB306; 3:B5S7LxyYcM2kcE+wwwZU2fu7kIp4s3qTiboi/NQBohdDDU4/4m1EqtYqfpQJVBS+Jqo9pMfoUvdturoTypYO+isKD9DBXJXsDZxoBt2IMIY3ytqfyer2HMFNpKgBSl1LqmC9T3aaYLh/iP8NcaqVqUsBE8g2qVbL0TIqNqJLLmKRsY11a+7xreEerY8K1SEfKElLMLU7Ch7p/xRnhDlQph43QwmEBonvdLT/0oOapv3kEMnHXGjWD8d4RWQwUCqH; 25:rX6574ocn9DBIvHJROwEZt7gYAK+spzbEezgcyNvskwb9424Ksklyi/Wr3zDQrMYRa2bQEef/Jb3XAq31z4/szlvgNLIU/M9kGgVG8LMwhWEDca0TYdP96wGHBKvnIz10U5sQTsGI66ww5rDz+1ytSlKx6ap2naONrFpouOH9rJNIekD1HIFquxEPHuqGCLLhXdEUMDnlG7wYdi278PnK0z+lBwL6CsdoVTQL4MkLvYILbFEX2R5CWjZX4hEC3QUh2C5K2tIg/Xx2PRWyxHkFM9nVqC7Q8XJ4syTssiiD6RakWW8rugBg93rm5itUfk7JcYsyXAfF+1mH3BeGR+6U8MW/YfR4synUtSawSTH3k4=; 31:ShjGGUQoLjHw5nhYM6fPCOt6IDTMU9P/z4LOs1UYae1LcS++RnsmIRfbxMIk4ZVfRBmwM1/0Gn9i2jfl4OblFAX2uNfN2/swxJutZBhZYMJBBg5YxjVOz2xm2hPtqGQSunwYqI16HCZuW99vpbaxHzdz5uFK0lS5qJdIwTIbq3wVN+O+cHHqnHR8S6j1Fs5qqAZU6wizUeGlNWa4d0q7KYEmSTw/U7J/5T2ZqisQzRg= X-MS-TrafficTypeDiagnostic: AM3PR07MB306: Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=simon.marchi@ericsson.com; X-Microsoft-Exchange-Diagnostics: 1; AM3PR07MB306; 20:nsM0G5MSvJiAptgWlywu7myQEVDoU/6Dq6uw+UJYarWczpyh7HMyqBzrH8M0soVPxIh1kHYLKrJ4iGrgs7tOIYJGuwq7LH4I+dx7uDCb5jXYFDU1/he1PQKnLYqnN88p8dB1SfePSGzTfUBmE+drNDrE9trsEgqq5a6P3uXV7VqDtm1G6C1Ser+rgSrghFf7c/WBcchBhM8GuniRTZ8LLhnJaU9DwbrCqzV5fAwvRO7e21maGjJbBSts9tNd3IOPQsCyjMPDtRbc2E4sZFSkjOqFd0PAJ1gPrwRlzDJ+H1LwAznIPgcgE32sQcJUVaYcbC4SlL+B+wqdJp+MLuhxKNVW6YGTt/GUBPrvLZEpfHP2y6xco+cPTse6r/NatcoYBoK2BUXO/zRcKs20683Ahi2nHl15URoTWWvH+iejFDLswXM9REHjDIJ24JjkF8vnKhlW9ylUXlP/EyK8l6eJ/6UXIetuN4BR5sKFGeZQacZoO1vIdWC8b40QB1lCJfpN; 4:QbavjDcWsVFHqpwSM47+/OGAJakDyvwGV/2jiZCjphZmpQBNUya5wW9on7dT/LqpHDjoZQ4XMBoroHbUEY+e4jXYdXR3ZyL8qTRJRJmPev82IrysBwXnSkhdzIcmau3KXIqGIAvJxnNJlf4ot1YL0cu5709h7JNOLbMjVJp7J1Jk8NNIqvrBwVM0NocrtpgMpMxUq3ySrndqijsi5/9L7s/dpeLTLlvAVGYnL5VLKSKJqZw6kz6YSSM0h2YNjkTwmMsNB/RCAz03z3ocVlbaTUbCVMGqGXQjEYmTRxHorrt4UR1PiJD9DVMsR4b/61Ki X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(37575265505322); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(5005006)(8121501046)(3231022)(93006095)(93001095)(3002001)(10201501046)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123564025)(20161123562025)(20161123560025)(20161123555025)(6072148)(201708071742011); SRVR:AM3PR07MB306; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:AM3PR07MB306; X-Forefront-PRVS: 05143A8241 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(376002)(366004)(39860400002)(54534003)(199004)(189003)(377424004)(107886003)(8676002)(5660300001)(48376002)(33646002)(4326008)(50466002)(106356001)(50226002)(81166006)(105586002)(81156014)(2361001)(25786009)(2351001)(6116002)(305945005)(69596002)(8936002)(7736002)(3846002)(36756003)(53416004)(52116002)(47776003)(53936002)(2906002)(68736007)(6486002)(6506006)(478600001)(16526018)(97736004)(316002)(6666003)(16586007)(6916009)(86362001)(6512007)(66066001)(51416003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM3PR07MB306; H:elxacz23q12.ericsson.se; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: ericsson.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM3PR07MB306; 23:C528rTikYIAWNYxPMaKKhm9y8lss/bcN0V3hScIiJe?= =?us-ascii?Q?ZjuNWZrXgVJDZ0/ObDh7ooc72EBO+H1j4I/eGRFYaDhWg89yJSqQhuYz50PL?= =?us-ascii?Q?iEixuvIFvCpXkKr17QzSzcAf7uEfxNegpesoPwEWsbQ9jQmSyXSLTdj4P8w3?= =?us-ascii?Q?oViTbpeTC/LDSuNTjkNW1oclsP+u0YjSuieBa8+zwG3HKPiSWQ3fAgPLundD?= =?us-ascii?Q?EsxSH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K?= =?us-ascii?Q?6JqFaT+VfSjtUDaO5Q//TErlc/ObB5?= X-Microsoft-Exchange-Diagnostics: 1; AM3PR07MB306; 6:/fXgZVIpM993FiNj9jk28oMOW0oRNsHLM86OCXRIEwMtp9PAf5h1FyEiuXoW+wK8CTw7vYy54KT5xvNYDw9cWOWuBMnio8nrZA0ZTbVWoRcJ6jTfDDZadTZzW/D1FndKum8OKw4MXboHxYeTeMBW/DjkDAWGD93nkyjfo4IvP7DtnEO4CNhx2/CSHdzTuazH2Htrkh757vf/OIKKP0RgQEoUu5wD+U17DnjE0FAWHKkbFRbv1Dzs8afLFqH/DfheraukLTBAk5nTBPwLlUi4ynAOciOuFor1RC9yVOSPW+h80jBN4QLzrZooiugnLtNudCkepg9qn8XcEf6OeDtK/uLSzvbUNKSgLCFN3LYGRKk=; 5:f/bhODyFPP4q1aMLO/+EMcBxG0KekGTgdW+4dcx1qnLVqV0DwEedmPr7hych+b0jCWEG+5b5uYa0f33OuQiacx7qQqj8pTz5NEVHwopTY37G0ATL/+h5KOt4qKLEqp9N0/xJ0vx4tSfAbNNOUPZGdn/YrMtJGLA1ZUGoNSonFog=; 24:EbXukEsiX1HhMAUspKMi93Z3hUBwe5KRL2nxSYurg/zFsY/XOO5rETOVHVJMXVlczW6FowL392iB7ARrzsofWkqQPOx8iR+Fu/lj1BMkSxc=; 7:ppKg5DTyz3mNHZi0RZPmElrIOrVTVEKryfPb/gIkMZ6xHsoiyJlWrjUaSYQlrMTNmoBwEvwrSbA/d0H+Zx60wMGOGKUSTscxFV/ePwfxaSOySinyvTzGHKwCq8h4oURsU1eTD/m6ane6mQpuN+qlL6D7bDGIjgjuNNpn3Scjm52p5qdTL4K0N16e5cPSuBbc7fAT5l9lDmssUh0t8/coA+CNO/5evRaz/iLIbZQYrwPmq2K+Qk3RfcHQ1J46ZhRu SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2017 22:42:39.9671 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2e254453-72d2-46b7-5bc8-08d53dc3d2a6 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 92e84ceb-fbfd-47ab-be52-080c6b87953f X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM3PR07MB306 X-OriginatorOrg: ericsson.com X-IsSubscribed: yes The prefix in test_bkpt_explicit_loc is wrong. Instead of using with_test_prefix directly, define test_bkpt_explicit_loc with proc_with_prefix. gdb/testsuite/ChangeLog: * gdb.python/py-breakpoint.exp (test_bkpt_explicit_loc): Define with proc_with_prefix, don't use with_test_prefix. --- gdb/testsuite/ChangeLog | 5 + gdb/testsuite/gdb.python/py-breakpoint.exp | 144 ++++++++++++++--------------- 2 files changed, 76 insertions(+), 73 deletions(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index acad330..87ec247 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-12-07 Simon Marchi + + * gdb.python/py-breakpoint.exp (test_bkpt_explicit_loc): Define + with proc_with_prefix, don't use with_test_prefix. + 2017-12-07 Tom Tromey * gdb.base/break.exp: Add test for empty "commands". diff --git a/gdb/testsuite/gdb.python/py-breakpoint.exp b/gdb/testsuite/gdb.python/py-breakpoint.exp index e89b9b8..699c98f 100644 --- a/gdb/testsuite/gdb.python/py-breakpoint.exp +++ b/gdb/testsuite/gdb.python/py-breakpoint.exp @@ -531,83 +531,81 @@ proc_with_prefix test_bkpt_events {} { check_last_event breakpoint_deleted } -proc test_bkpt_explicit_loc {} { +proc_with_prefix test_bkpt_explicit_loc {} { global srcfile testfile - with_test_prefix test_bkpt_invisible { - # Start with a fresh gdb. - clean_restart ${testfile} - - if ![runto_main] then { - fail "cannot run to main." - return 0 - } + # Start with a fresh gdb. + clean_restart ${testfile} - delete_breakpoints - - set bp_location1 [gdb_get_line_number "Break at multiply."] - set bp_location2 [gdb_get_line_number "Break at add."] - - gdb_py_test_silent_cmd "python bp1 = gdb.Breakpoint (line=$bp_location1)" \ - "set explicit breakpoint by line" 0 - gdb_continue_to_breakpoint "break at multiply for explicit line" \ - ".*Break at multiply.*" - - gdb_py_test_silent_cmd "python bp1 = gdb.Breakpoint (line=\"+1\")" \ - "set explicit breakpoint by relative line" 0 - gdb_continue_to_breakpoint "break at add for relative line" \ - ".*Break at add.*" - - delete_breakpoints - gdb_py_test_silent_cmd "python bp1 = gdb.Breakpoint (line=\"-1\")" \ - "set explicit breakpoint by relative negative line" 0 - gdb_continue_to_breakpoint "break at multiply for negative line" \ - ".*Break at multiply.*" - - delete_breakpoints - gdb_test "python bp1 = gdb.Breakpoint (line=bp1)" \ - "RuntimeError: Line keyword should be an integer or a string.*" \ - "set explicit breakpoint by invalid line type" - - delete_breakpoints - gdb_py_test_silent_cmd "python bp1 = gdb.Breakpoint (function=\"add\")" \ - "set explicit breakpoint by function" 0 - gdb_continue_to_breakpoint "break at function add for function" \ - ".*Break at function add.*" - - delete_breakpoints - gdb_py_test_silent_cmd "python bp1 = gdb.Breakpoint (source=\"$srcfile\", function=\"add\")" \ - "set explicit breakpoint by source file and function" 0 - gdb_continue_to_breakpoint "break at function add for source and function" \ - ".*Break at function add.*" - - delete_breakpoints - gdb_py_test_silent_cmd "python bp1 = gdb.Breakpoint (source=\"$srcfile\", line=\"$bp_location2\")" \ - "set explicit breakpoint by source file and line number" 0 - gdb_continue_to_breakpoint "break at add for source and line" \ - ".*Break at add.*" - - delete_breakpoints - gdb_py_test_silent_cmd "python bp1 = gdb.Breakpoint (\"-source $srcfile -line $bp_location2\")" \ - "set explicit breakpoint by source file and line number in spec" 0 - gdb_continue_to_breakpoint "break at add for source and line in spec" \ - ".*Break at add.*" - - delete_breakpoints - gdb_test "python bp1 = gdb.Breakpoint (source=\"$srcfile\")" \ - "RuntimeError: Specifying a source must also include a line, label or function.*" \ - "set invalid explicit breakpoint by source only" - - gdb_test "python bp1 = gdb.Breakpoint (source=\"foo.c\", line=\"5\")" \ - "No source file named foo.*" \ - "set invalid explicit breakpoint by missing source and line" - gdb_test "python bp1 = gdb.Breakpoint (source=\"$srcfile\", line=\"900\")" \ - "No line 900 in file \"$srcfile\".*" \ - "set invalid explicit breakpoint by source and invalid line" - gdb_test "python bp1 = gdb.Breakpoint (function=\"blah\")" \ - "Function \"blah\" not defined.*" \ - "set invalid explicit breakpoint by missing function" + if ![runto_main] then { + fail "cannot run to main." + return 0 } + + delete_breakpoints + + set bp_location1 [gdb_get_line_number "Break at multiply."] + set bp_location2 [gdb_get_line_number "Break at add."] + + gdb_py_test_silent_cmd "python bp1 = gdb.Breakpoint (line=$bp_location1)" \ + "set explicit breakpoint by line" 0 + gdb_continue_to_breakpoint "break at multiply for explicit line" \ + ".*Break at multiply.*" + + gdb_py_test_silent_cmd "python bp1 = gdb.Breakpoint (line=\"+1\")" \ + "set explicit breakpoint by relative line" 0 + gdb_continue_to_breakpoint "break at add for relative line" \ + ".*Break at add.*" + + delete_breakpoints + gdb_py_test_silent_cmd "python bp1 = gdb.Breakpoint (line=\"-1\")" \ + "set explicit breakpoint by relative negative line" 0 + gdb_continue_to_breakpoint "break at multiply for negative line" \ + ".*Break at multiply.*" + + delete_breakpoints + gdb_test "python bp1 = gdb.Breakpoint (line=bp1)" \ + "RuntimeError: Line keyword should be an integer or a string.*" \ + "set explicit breakpoint by invalid line type" + + delete_breakpoints + gdb_py_test_silent_cmd "python bp1 = gdb.Breakpoint (function=\"add\")" \ + "set explicit breakpoint by function" 0 + gdb_continue_to_breakpoint "break at function add for function" \ + ".*Break at function add.*" + + delete_breakpoints + gdb_py_test_silent_cmd "python bp1 = gdb.Breakpoint (source=\"$srcfile\", function=\"add\")" \ + "set explicit breakpoint by source file and function" 0 + gdb_continue_to_breakpoint "break at function add for source and function" \ + ".*Break at function add.*" + + delete_breakpoints + gdb_py_test_silent_cmd "python bp1 = gdb.Breakpoint (source=\"$srcfile\", line=\"$bp_location2\")" \ + "set explicit breakpoint by source file and line number" 0 + gdb_continue_to_breakpoint "break at add for source and line" \ + ".*Break at add.*" + + delete_breakpoints + gdb_py_test_silent_cmd "python bp1 = gdb.Breakpoint (\"-source $srcfile -line $bp_location2\")" \ + "set explicit breakpoint by source file and line number in spec" 0 + gdb_continue_to_breakpoint "break at add for source and line in spec" \ + ".*Break at add.*" + + delete_breakpoints + gdb_test "python bp1 = gdb.Breakpoint (source=\"$srcfile\")" \ + "RuntimeError: Specifying a source must also include a line, label or function.*" \ + "set invalid explicit breakpoint by source only" + + gdb_test "python bp1 = gdb.Breakpoint (source=\"foo.c\", line=\"5\")" \ + "No source file named foo.*" \ + "set invalid explicit breakpoint by missing source and line" + gdb_test "python bp1 = gdb.Breakpoint (source=\"$srcfile\", line=\"900\")" \ + "No line 900 in file \"$srcfile\".*" \ + "set invalid explicit breakpoint by source and invalid line" + gdb_test "python bp1 = gdb.Breakpoint (function=\"blah\")" \ + "Function \"blah\" not defined.*" \ + "set invalid explicit breakpoint by missing function" } test_bkpt_basic