[binutils-gdb] gdb/testsuite: Fix formatting of python script
Bruno Larsen
blarsen@sourceware.org
Tue Oct 11 09:41:24 GMT 2022
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=73fa80feee65dde8cbbdacca1b76b4f3f6af62cb
commit 73fa80feee65dde8cbbdacca1b76b4f3f6af62cb
Author: Bruno Larsen <blarsen@redhat.com>
Date: Tue Oct 11 11:22:37 2022 +0200
gdb/testsuite: Fix formatting of python script
The python black formatter was complaining about formatting on the
script gdb.python/pretty-print-call-by-hand.py. This commit changed
the offending lines to make the formatter happy.
Diff:
---
gdb/testsuite/gdb.python/pretty-print-call-by-hand.py | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/gdb/testsuite/gdb.python/pretty-print-call-by-hand.py b/gdb/testsuite/gdb.python/pretty-print-call-by-hand.py
index f8f5df678f8..5343af831a7 100644
--- a/gdb/testsuite/gdb.python/pretty-print-call-by-hand.py
+++ b/gdb/testsuite/gdb.python/pretty-print-call-by-hand.py
@@ -21,21 +21,25 @@ class MytypePrinter:
self.val = val
def to_string(self):
- calls = gdb.parse_and_eval('f()')
- return "mytype is %s" % self.val['x']
+ calls = gdb.parse_and_eval("f()")
+ return "mytype is %s" % self.val["x"]
+
def ec_lookup_function(val):
typ = val.type
if typ.code == gdb.TYPE_CODE_REF:
typ = typ.target()
- if str(typ) == 'struct mytype':
+ if str(typ) == "struct mytype":
return MytypePrinter(val)
return None
+
def disable_lookup_function():
ec_lookup_function.enabled = False
+
def enable_lookup_function():
ec_lookup_function.enabled = True
+
gdb.pretty_printers.append(ec_lookup_function)
More information about the Gdb-cvs
mailing list