From patchwork Wed Nov 20 21:35:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergio Durigan Junior X-Patchwork-Id: 36074 Received: (qmail 2393 invoked by alias); 20 Nov 2019 21:35:35 -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 2346 invoked by uid 89); 20 Nov 2019 21:35:34 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-16.1 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3 autolearn=ham version=3.3.1 spammy= X-HELO: us-smtp-1.mimecast.com Received: from us-smtp-delivery-1.mimecast.com (HELO us-smtp-1.mimecast.com) (205.139.110.120) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 20 Nov 2019 21:35:33 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574285731; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Ak3gQPnsUKYE/aOLf8QoPcE6ZBH+dV1+jRfutMTiUKM=; b=ZfLq23MCPoWG2DqBFiEPoTXU1NCmFDCJgHQZLiQC5ANT3Pjb6W0ow5mXnUbz8j5a6MgZ2f rHaUlTlxfeRfesyGlGA7PG0JaW5rnMOFQq2ip0t7tEor9Mv64TZHNFdUgH9mWpLAmAbT/7 Z97aJ68jptaV3ghCg/ubpTmOjLuahz8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-114-gotlWQytMS-_1LIlg6wV2Q-1; Wed, 20 Nov 2019 16:35:28 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B6EF41802D07; Wed, 20 Nov 2019 21:35:27 +0000 (UTC) Received: from psique.yyz.redhat.com (unused-10-15-17-196.yyz.redhat.com [10.15.17.196]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6EC0F6B49B; Wed, 20 Nov 2019 21:35:24 +0000 (UTC) From: Sergio Durigan Junior To: GDB Patches Cc: andrew.burgess@embecosm.com, Sergio Durigan Junior Subject: [PATCH] Add missing parentheses on 'print' (gdb.python/py-progspace.exp) Date: Wed, 20 Nov 2019 16:35:13 -0500 Message-Id: <20191120213513.29706-1-sergiodj@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-IsSubscribed: yes Commit 33d569b709886a1208145806da80b689d9cae9da ("gdb/python: Return None from Progspace.block_for_pc on error") added a few tests on gdb.python/py-progspace.exp which use 'print', but forgot to use parentheses when passing the arguments to be printed. This fails on Python 3. This commit adds these missing parentheses. Pushed as obvious. gdb/testsuite/ChangeLog: 2019-11-20 Sergio Durigan Junior * gdb.python/py-progspace.exp: Add missing parentheses on some 'print' commands. Change-Id: Iac0a7578855d128bbee3b98e7ea5888dae55fc00 --- gdb/testsuite/ChangeLog | 5 +++++ gdb/testsuite/gdb.python/py-progspace.exp | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 32dc308332..f47ed172a6 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-11-20 Sergio Durigan Junior + + * gdb.python/py-progspace.exp: Add missing parentheses on some + 'print' commands. + 2019-11-19 Tom Tromey * gdb.tui/winheight.exp: New file. diff --git a/gdb/testsuite/gdb.python/py-progspace.exp b/gdb/testsuite/gdb.python/py-progspace.exp index d1bcb81bb4..46194412fb 100644 --- a/gdb/testsuite/gdb.python/py-progspace.exp +++ b/gdb/testsuite/gdb.python/py-progspace.exp @@ -61,14 +61,14 @@ if {![runto_main]} { set pc_val [get_integer_valueof "\$pc" 0] gdb_py_test_silent_cmd "python blk = gdb.current_progspace ().block_for_pc (${pc_val})" \ "get block for the current \$pc" 1 -gdb_test "python print blk.start <= ${pc_val}" "True" \ +gdb_test "python print (blk.start <= ${pc_val})" "True" \ "block start is before \$pc" -gdb_test "python print blk.end >= ${pc_val}" "True" \ +gdb_test "python print (blk.end >= ${pc_val})" "True" \ "block end is after \$pc" # Check what happens when we ask for a block of an invalid address. if ![is_address_zero_readable] { - gdb_test "python print gdb.current_progspace ().block_for_pc (0)" "None" + gdb_test "python print (gdb.current_progspace ().block_for_pc (0))" "None" } # With a single inferior, progspace.objfiles () and gdb.objfiles () should