From patchwork Sun Apr 26 14:02:10 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siva Chandra Reddy X-Patchwork-Id: 6453 Received: (qmail 23232 invoked by alias); 26 Apr 2015 14:02:14 -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 23220 invoked by uid 89); 26 Apr 2015 14:02:13 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mail-ob0-f180.google.com Received: from mail-ob0-f180.google.com (HELO mail-ob0-f180.google.com) (209.85.214.180) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Sun, 26 Apr 2015 14:02:12 +0000 Received: by oblw8 with SMTP id w8so67101543obl.0 for ; Sun, 26 Apr 2015 07:02:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to:cc :content-type; bh=6FOX/RWaV+KT0sorFCMAlmlpigEl+HF4ChtIdy2EtsA=; b=W8x+zky3dypPSyPafvJnTlKfVtRmPf94Jjb/CRf/keHaFSIcMmj8f3PHPSQn6+L40q eR0B8B/jj4425l8bWnX1P4bbT2qT8OciPQXX77JcoHKqmzs3P31zSBqId1JQyciGxC/N fmJBs4KdszF1UYcRLQK8vurBCOCqXebDKOC9TiwGTw4E3aPiWlLYsP5+/lW4M2n9e4kT WYLemJ7FfAioK9IUYy0hETQMu19WpcSy/5VI2hWkerdvAXQHB/xCElG+GBcyz+EqBmUP K8drhznxX2jIFPQIDDUvN6xnrvEjl7f4ugUsFAopa6jPulExG22WU0zyA/5nXYEWwPZY bvyg== X-Gm-Message-State: ALoCoQkz3XwIvzC3cq62Ik6KbFuTQyr7wkBMf/mZVg4/kwbEcqrNmd0yCkDUuBLl1+4gQDQycRgx MIME-Version: 1.0 X-Received: by 10.60.61.66 with SMTP id n2mr6147966oer.67.1430056930897; Sun, 26 Apr 2015 07:02:10 -0700 (PDT) Received: by 10.202.83.83 with HTTP; Sun, 26 Apr 2015 07:02:10 -0700 (PDT) Date: Sun, 26 Apr 2015 07:02:10 -0700 Message-ID: Subject: [PR python/18291] Fix printing of "disabled" status of xmethod matchers. From: Siva Chandra To: gdb-patches Cc: Doug Evans X-IsSubscribed: yes gdb/ChangeLog: 2015-04-26 Siva Chandra Reddy PR python/18291 * python/lib/gdb/command/xmethods.py (print_xm_info): Fix typo. Print xmethod matcher status. gdb/testsuite/ChangeLog: 2015-04-26 Siva Chandra Reddy PR python/18291 * gdb.python/py-xmethods.exp: Add tests. diff --git a/gdb/python/lib/gdb/command/xmethods.py b/gdb/python/lib/gdb/command/xmethods.py index 37ed2c1..0788a81 100644 --- a/gdb/python/lib/gdb/command/xmethods.py +++ b/gdb/python/lib/gdb/command/xmethods.py @@ -117,7 +117,7 @@ def get_method_matchers_in_loci(loci, locus_re, matcher_re): def print_xm_info(xm_dict, name_re): """Print a dictionary of xmethods.""" - def get_status_string(method): + def get_status_string(m): if not m.enabled: return " [disabled]" else: @@ -130,7 +130,7 @@ def print_xm_info(xm_dict, name_re): continue print ("Xmethods in %s:" % locus_str) for matcher in xm_dict[locus_str]: - print (" %s" % matcher.name) + print (" %s%s" % (matcher.name, get_status_string(matcher))) if not matcher.methods: continue for m in matcher.methods: diff --git a/gdb/testsuite/gdb.python/py-xmethods.exp b/gdb/testsuite/gdb.python/py-xmethods.exp index a83b14d..f0236c0 100644 --- a/gdb/testsuite/gdb.python/py-xmethods.exp +++ b/gdb/testsuite/gdb.python/py-xmethods.exp @@ -149,3 +149,6 @@ gdb_test_no_output "disable xmethod progspace E_methods;method_int" \ "disable xmethod progspace E_methods;method_int" gdb_test "info xmethod progspace E_methods;method_int" ".* \\\[disabled\\\]" \ "info xmethod xmethods E_methods;method_int" +gdb_test_no_output "disable xmethod progspace G_methods" "Disable G_methods 2" +gdb_test "info xmethod progspace" ".*G_methods \\\[disabled\\\].*" \ + "info xmethod progspace"