From: Pedro Silva Date: Mon, 11 Nov 2024 08:07:07 +0000 (+0000) Subject: gdb: fix missing operator % on xmethod matcher output X-Git-Tag: gdb-16-branchpoint~480 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=272eacf34fd07101995615dac971f07546fa79dd;p=thirdparty%2Fbinutils-gdb.git gdb: fix missing operator % on xmethod matcher output Fixed missing operator % on xmethod matcher registration output and, as suggested on bug 32532, converted both uses of operator % to str.format. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32352 Change-Id: Ic471516292c2f1d6d1284aaeaea3ec14421decb8 --- diff --git a/gdb/python/lib/gdb/xmethod.py b/gdb/python/lib/gdb/xmethod.py index c98402d271f..e12d51c2c95 100644 --- a/gdb/python/lib/gdb/xmethod.py +++ b/gdb/python/lib/gdb/xmethod.py @@ -266,9 +266,14 @@ def register_xmethod_matcher(locus, matcher, replace=False): del locus.xmethods[index] else: raise RuntimeError( - "Xmethod matcher already registered with " - "%s: %s" % (locus_name, matcher.name) + "Xmethod matcher already registered with {}: {}".format( + locus_name, matcher.name + ) ) if gdb.parameter("verbose"): - gdb.write("Registering xmethod matcher '%s' with %s' ...\n") + gdb.write( + "Registering xmethod matcher '{}' with '{}' ...\n".format( + locus_name, matcher.name + ) + ) locus.xmethods.insert(0, matcher)