From patchwork Mon Jun 6 17:22:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 12800 Received: (qmail 87021 invoked by alias); 6 Jun 2016 17:23:10 -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 86555 invoked by uid 89); 6 Jun 2016 17:23:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.8 required=5.0 tests=AWL, BAYES_00, FSL_HELO_HOME, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=no version=3.3.2 spammy=non-existent, sk:af4ddcc, sk:3b305a6, H*MI:tom X-HELO: gproxy1-pub.mail.unifiedlayer.com Received: from gproxy1-pub.mail.unifiedlayer.com (HELO gproxy1-pub.mail.unifiedlayer.com) (69.89.25.95) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with SMTP; Mon, 06 Jun 2016 17:22:59 +0000 Received: (qmail 3803 invoked by uid 0); 6 Jun 2016 17:22:57 -0000 Received: from unknown (HELO CMOut01) (10.0.90.82) by gproxy1.mail.unifiedlayer.com with SMTP; 6 Jun 2016 17:22:57 -0000 Received: from box522.bluehost.com ([74.220.219.122]) by CMOut01 with id 3VNs1t01U2f2jeq01VNvXK; Mon, 06 Jun 2016 11:22:55 -0600 X-Authority-Analysis: v=2.1 cv=OPe0g0qB c=1 sm=1 tr=0 a=GsOEXm/OWkKvwdLVJsfwcA==:117 a=GsOEXm/OWkKvwdLVJsfwcA==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=PnD2wP_eR3oA:10 a=-N9Dh3nx2ZYA:10 a=pD_ry4oyNxEA:10 a=zstS-IiYAAAA:8 a=qUXFsv20AAAA:8 a=OzhG_j2prInZM9Zddj0A:9 a=4G6NA9xxw8l3yy4pmD5M:22 a=9MODbo6-FXLeArg8YEg9:22 Received: from [65.128.48.199] (port=45498 helo=bapiya.Home) by box522.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.86_2) (envelope-from ) id 1b9yEn-0005hR-Go; Mon, 06 Jun 2016 11:22:53 -0600 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [RFA] Fix PR python/20129 - use of non-existing variable Date: Mon, 6 Jun 2016 11:22:45 -0600 Message-Id: <1465233765-15675-1-git-send-email-tom@tromey.com> X-Identified-User: {36111:box522.bluehost.com:elynrobi:tromey.com} {sentby:smtp auth 65.128.48.199 authed with tom+tromey.com} X-Exim-ID: 1b9yEn-0005hR-Go X-Source-Sender: (bapiya.Home) [65.128.48.199]:45498 X-Source-Auth: tom+tromey.com X-Email-Count: 0 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTIyLmJsdWVob3N0LmNvbQ== PR python/20129 concerns the error message one gets from a command like "disable frame-filter global NoSuchFilter". Currently this throws a second, unexpected, exception due to the use of a non-existing variable named "name". This patch adds regression tests and fixes a couple of spots to use the correct variable name. Built and regtested on x86-64 Fedora 23. 2016-06-06 Tom Tromey PR python/20129: * python/lib/gdb/command/frame_filters.py (_do_enable_frame_filter) (SetFrameFilterPriority._set_filter_priority): Use "frame_filter", not "name". 2016-06-06 Tom Tromey PR python/20129: * gdb.python/py-framefilter.exp: Add tests for setting priority and disabling of non-existent frame filter. --- gdb/ChangeLog | 7 +++++++ gdb/python/lib/gdb/command/frame_filters.py | 4 ++-- gdb/testsuite/ChangeLog | 6 ++++++ gdb/testsuite/gdb.python/py-framefilter.exp | 6 ++++++ 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index af4ddcc..525ec33 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2016-06-06 Tom Tromey + + PR python/20129: + * python/lib/gdb/command/frame_filters.py (_do_enable_frame_filter) + (SetFrameFilterPriority._set_filter_priority): Use "frame_filter", + not "name". + 2016-06-02 Jon Turney * windows-nat.c (handle_output_debug_string): Return type of diff --git a/gdb/python/lib/gdb/command/frame_filters.py b/gdb/python/lib/gdb/command/frame_filters.py index c9d4f3e..29c2973 100644 --- a/gdb/python/lib/gdb/command/frame_filters.py +++ b/gdb/python/lib/gdb/command/frame_filters.py @@ -150,7 +150,7 @@ def _do_enable_frame_filter(command_tuple, flag): try: ff = op_list[frame_filter] except KeyError: - msg = "frame-filter '" + str(name) + "' not found." + msg = "frame-filter '" + str(frame_filter) + "' not found." raise gdb.GdbError(msg) gdb.frames.set_enabled(ff, flag) @@ -347,7 +347,7 @@ class SetFrameFilterPriority(gdb.Command): try: ff = op_list[frame_filter] except KeyError: - msg = "frame-filter '" + str(name) + "' not found." + msg = "frame-filter '" + str(frame_filter) + "' not found." raise gdb.GdbError(msg) gdb.frames.set_priority(ff, priority) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 3b305a6..6013e78 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2016-06-06 Tom Tromey + + PR python/20129: + * gdb.python/py-framefilter.exp: Add tests for setting priority + and disabling of non-existent frame filter. + 2016-06-02 Tom Tromey PR python/18984: diff --git a/gdb/testsuite/gdb.python/py-framefilter.exp b/gdb/testsuite/gdb.python/py-framefilter.exp index aea4b45..8bbdcd3 100644 --- a/gdb/testsuite/gdb.python/py-framefilter.exp +++ b/gdb/testsuite/gdb.python/py-framefilter.exp @@ -104,6 +104,9 @@ gdb_test "show frame-filter priority global Elider" \ gdb_test "info frame-filter" \ ".*1000.*Yes.*Elider.*100.*Yes.*Reverse.*10.*.*No.*Object.*1.*" \ "info frame filter after setting priority" +gdb_test "set frame-filter priority global NoSuchFilter 900" \ + "frame-filter 'NoSuchFilter' not found." \ + "set priority of a non-existing filter" # Test enable/disable gdb_test "info frame-filter" \ @@ -119,6 +122,9 @@ gdb_test_no_output "enable frame-filter global Elider" \ gdb_test "info frame-filter" \ ".*1000.*Yes.*Elider.*100.*Yes.*Reverse.*10.*.*No.*Object.*1.*" \ "info frame filter after reenabling frame filter" +gdb_test "disable frame-filter global NoSuchFilter" \ + "frame-filter 'NoSuchFilter' not found." \ + "disable a non-existing filter" # Test no-filters gdb_test "bt no-filters" \