This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb] [PR python/18291] Fix printing of "disabled" status of xmethod matchers.
- From: Siva Chandra Reddy <sivachandra at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 8 May 2015 14:20:45 -0000
- Subject: [binutils-gdb] [PR python/18291] Fix printing of "disabled" status of xmethod matchers.
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=df2eb078c0a88a44c49de7045a1c163f380a7efc
commit df2eb078c0a88a44c49de7045a1c163f380a7efc
Author: Siva Chandra <sivachandra@chromium.org>
Date: Sat Apr 25 17:10:30 2015 -0700
[PR python/18291] Fix printing of "disabled" status of xmethod matchers.
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.
Diff:
---
gdb/ChangeLog | 6 ++++++
gdb/python/lib/gdb/command/xmethods.py | 4 ++--
gdb/testsuite/ChangeLog | 5 +++++
gdb/testsuite/gdb.python/py-xmethods.exp | 3 +++
4 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index c7e8c88..2df4546 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -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
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/ChangeLog b/gdb/testsuite/ChangeLog
index 0caddbd..93a0e7f 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -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
diff --git a/gdb/testsuite/gdb.python/py-xmethods.exp b/gdb/testsuite/gdb.python/py-xmethods.exp
index eea1283..712f271 100644
--- a/gdb/testsuite/gdb.python/py-xmethods.exp
+++ b/gdb/testsuite/gdb.python/py-xmethods.exp
@@ -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.