aboutsummaryrefslogtreecommitdiff
path: root/gdb/python
diff options
context:
space:
mode:
authorSiva Chandra <sivachandra@chromium.org>2014-06-18 03:46:37 -0700
committerSiva Chandra <sivachandra@chromium.org>2014-06-23 04:57:51 -0700
commit70afc5b72d36dabf0a152e219ac981b2b45c138a (patch)
tree8115c8f9c2bbf762873a7b05c7c5c99473743c7c /gdb/python
parentb972bd9c133c8acd3f5ce8d05a4fdfc85aee2c15 (diff)
downloadgdb-70afc5b72d36dabf0a152e219ac981b2b45c138a.zip
gdb-70afc5b72d36dabf0a152e219ac981b2b45c138a.tar.gz
gdb-70afc5b72d36dabf0a152e219ac981b2b45c138a.tar.bz2
Align behavior of xmethod commands with that of pretty-printer commands.
Currently, the xmethod commands lookup xmethod matchers in the current progspace even if the locus regular expression matches the progspace's filename. Pretty printer commands do not match the current progspace's filename. gdb/ * python/lib/gdb/command/xmethods.py (get_method_matchers_in_loci): Lookup xmethod matchers in the current progspace only if the string "progspace" matches LOCUS_RE. gdb/testsuite * gdb.python/py-xmethods.exp: Use "progspace" instead of the progspace's filename in 'info', 'enable' and 'disable' command tests.
Diffstat (limited to 'gdb/python')
-rw-r--r--gdb/python/lib/gdb/command/xmethods.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/gdb/python/lib/gdb/command/xmethods.py b/gdb/python/lib/gdb/command/xmethods.py
index 31f9cdd..55cc81f 100644
--- a/gdb/python/lib/gdb/command/xmethods.py
+++ b/gdb/python/lib/gdb/command/xmethods.py
@@ -87,8 +87,11 @@ def get_method_matchers_in_loci(loci, locus_re, matcher_re):
Arguments:
loci: The list of loci to lookup matching xmethods in.
- locus_re: Xmethod matchers will be looked up in a particular locus
- only if its filename matches the regular expression LOCUS_RE.
+ locus_re: If a locus is an objfile, then xmethod matchers will be
+ looked up in it only if its filename matches the regular
+ expression LOCUS_RE. If a locus is the current progspace,
+ then xmethod matchers will be looked up in it only if the
+ string "progspace" matches LOCUS_RE.
matcher_re: The regular expression to match the xmethod matcher
names.
@@ -99,8 +102,7 @@ def get_method_matchers_in_loci(loci, locus_re, matcher_re):
xm_dict = {}
for locus in loci:
if isinstance(locus, gdb.Progspace):
- if (not locus_re.match(locus.filename) and
- not locus_re.match('progspace')):
+ if not locus_re.match('progspace'):
continue
locus_type = "progspace"
else: