From patchwork Wed Nov 26 18:33:53 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 3954 Received: (qmail 374 invoked by alias); 26 Nov 2014 18:34:04 -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 359 invoked by uid 89); 26 Nov 2014 18:34:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL, BAYES_00, SPF_PASS autolearn=ham version=3.3.2 X-HELO: usevmg20.ericsson.net Received: from usevmg20.ericsson.net (HELO usevmg20.ericsson.net) (198.24.6.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Wed, 26 Nov 2014 18:34:02 +0000 Received: from EUSAAHC001.ericsson.se (Unknown_Domain [147.117.188.75]) by usevmg20.ericsson.net (Symantec Mail Security) with SMTP id 78.12.05330.4A3C5745; Wed, 26 Nov 2014 13:12:20 +0100 (CET) Received: from simark-hp.mo.ca.am.ericsson.se (147.117.188.8) by smtps-am.internal.ericsson.com (147.117.188.75) with Microsoft SMTP Server (TLS) id 14.3.195.1; Wed, 26 Nov 2014 13:33:59 -0500 From: Simon Marchi To: CC: Simon Marchi Subject: [PATCH] Add more missing parentheses to Python calls to print Date: Wed, 26 Nov 2014 13:33:53 -0500 Message-ID: <1417026833-781-1-git-send-email-simon.marchi@ericsson.com> MIME-Version: 1.0 X-IsSubscribed: yes I noticed that there are calls to Python's print outside the gdb.python directory, so this patch adds those that I found were missing. They were found by grepping for "python print [^(]", so it's always possible that I missed some others that use another pattern. Parentheses are mandatory with Python 3 when calling print. gdb/testsuite/ChangeLog: * gdb.ada/py_range.exp: Add missing parentheses. * gdb.dwarf2/symtab-producer.exp: Same. * gdb.gdb/python-interrupts.exp: Same. * gdb.gdb/python-selftest.exp: Same. --- gdb/testsuite/gdb.ada/py_range.exp | 6 +++--- gdb/testsuite/gdb.dwarf2/symtab-producer.exp | 4 ++-- gdb/testsuite/gdb.gdb/python-interrupts.exp | 2 +- gdb/testsuite/gdb.gdb/python-selftest.exp | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/gdb/testsuite/gdb.ada/py_range.exp b/gdb/testsuite/gdb.ada/py_range.exp index 3fa029a..3e4cc81 100644 --- a/gdb/testsuite/gdb.ada/py_range.exp +++ b/gdb/testsuite/gdb.ada/py_range.exp @@ -30,11 +30,11 @@ if { [skip_python_tests] } { continue } set bp_location [gdb_get_line_number "STOP" ${testdir}/foo.adb] runto "foo.adb:$bp_location" -gdb_test "python print int(gdb.parse_and_eval('sr'))" \ +gdb_test "python print (int(gdb.parse_and_eval('sr')))" \ "48" -gdb_test "python print int(gdb.parse_and_eval('si'))" \ +gdb_test "python print (int(gdb.parse_and_eval('si')))" \ "740804" -gdb_test "python print int(gdb.parse_and_eval('ir'))" \ +gdb_test "python print (int(gdb.parse_and_eval('ir')))" \ "974" diff --git a/gdb/testsuite/gdb.dwarf2/symtab-producer.exp b/gdb/testsuite/gdb.dwarf2/symtab-producer.exp index 57cf04c..2081cff 100644 --- a/gdb/testsuite/gdb.dwarf2/symtab-producer.exp +++ b/gdb/testsuite/gdb.dwarf2/symtab-producer.exp @@ -95,9 +95,9 @@ if { [skip_python_tests] } { continue } gdb_py_test_silent_cmd "python with_producer = gdb.lookup_global_symbol(\"with_producer\")" \ "get with_producer symbol" 0 -gdb_test "python print with_producer.symtab.producer" "ACME Compiler Company" +gdb_test "python print (with_producer.symtab.producer)" "ACME Compiler Company" gdb_py_test_silent_cmd "python without_producer = gdb.lookup_global_symbol(\"without_producer\")" \ "get without_producer symbol" 0 -gdb_test "python print without_producer.symtab.producer" "None" +gdb_test "python print (without_producer.symtab.producer)" "None" diff --git a/gdb/testsuite/gdb.gdb/python-interrupts.exp b/gdb/testsuite/gdb.gdb/python-interrupts.exp index a41fc0c..70a3aea 100644 --- a/gdb/testsuite/gdb.gdb/python-interrupts.exp +++ b/gdb/testsuite/gdb.gdb/python-interrupts.exp @@ -25,7 +25,7 @@ proc test_python_interrupts {} { } gdb_breakpoint set_active_ext_lang temporary - gdb_test "call catch_command_errors(execute_command, \"python print 5\", 0, RETURN_MASK_ALL)" \ + gdb_test "call catch_command_errors(execute_command, \"python print (5)\", 0, RETURN_MASK_ALL)" \ "Temporary breakpoint.*silently stop." gdb_test "signal SIGINT" \ "KeyboardInterrupt.*Error while executing Python code." diff --git a/gdb/testsuite/gdb.gdb/python-selftest.exp b/gdb/testsuite/gdb.gdb/python-selftest.exp index 017fc38..efe8698 100644 --- a/gdb/testsuite/gdb.gdb/python-selftest.exp +++ b/gdb/testsuite/gdb.gdb/python-selftest.exp @@ -22,7 +22,7 @@ proc selftest_python {} { } gdb_test_no_output "set variable gdb_python_initialized = 0" - gdb_test "call catch_command_errors(execute_command, \"python print 5\", 0, RETURN_MASK_ALL)" \ + gdb_test "call catch_command_errors(execute_command, \"python print (5)\", 0, RETURN_MASK_ALL)" \ "Python not initialized.* = 0" return 0 }