[PR python/18291] Fix printing of "disabled" status of xmethod matchers.
authorSiva Chandra <sivachandra@chromium.org>
Sun, 26 Apr 2015 00:10:30 +0000 (17:10 -0700)
committerSiva Chandra <sivachandra@chromium.org>
Fri, 8 May 2015 14:20:04 +0000 (07:20 -0700)
gdb/ChangeLog:

PR python/18291
* python/lib/gdb/command/xmethods.py (print_xm_info): Fix typo.
Print xmethod matcher status.

gdb/testsuite/ChangeLog:

PR python/18291
* gdb.python/py-xmethods.exp: Add tests.

gdb/ChangeLog
gdb/python/lib/gdb/command/xmethods.py
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.python/py-xmethods.exp

index c7e8c88d776b0c87e98a922e98aef76173177a46..2df4546f6cf3ef4931c2d089719d86f2b0e73614 100644 (file)
@@ -1,3 +1,9 @@
+2015-05-08  Siva Chandra Reddy  <sivachandra@google.com>
+
+       PR python/18291
+       * python/lib/gdb/command/xmethods.py (print_xm_info): Fix typo.
+       Print xmethod matcher status.
+
 2015-05-08  Andreas Arnez  <arnez@linux.vnet.ibm.com>
 
        * s390-linux-nat.c (fill_gregset): Avoid relying on the PSWA
index 37ed2c1dbb35c9e32afeeda548cf95decde885eb..0788a81b33aaabf88046faf1841eb624d21f025c 100644 (file)
@@ -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:
index 0caddbd0a0bb6e75246d729b3756e2e68497f932..93a0e7f75f6a7b8f0144149df471ae11472e9afb 100644 (file)
@@ -1,3 +1,8 @@
+2015-05-08  Siva Chandra Reddy  <sivachandra@google.com>
+
+       PR python/18291
+       * gdb.python/py-xmethods.exp: Add tests.
+
 2015-05-08  Yao Qi  <yao.qi@linaro.org>
 
        PR gdb/18208
index eea1283ba17bf7ff3e942531468cce799a1e73f8..712f271be22eabf9beb0e9c03cec91b7ce921a36 100644 (file)
@@ -150,6 +150,9 @@ 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"
 
 # PR 18285
 # First make sure both are enabled.