diff options
author | Simon Marchi <simon.marchi@efficios.com> | 2022-03-21 09:59:01 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@efficios.com> | 2022-03-21 09:59:01 -0400 |
commit | 4b19214f7920a4dbb7acf42a4da667600d23bd6a (patch) | |
tree | 3d1f94db9d306d50bc1604e06df9eecb16c3c1ce | |
parent | daaf7acf47a12d10459060dca5500b63273cd683 (diff) | |
download | gdb-4b19214f7920a4dbb7acf42a4da667600d23bd6a.zip gdb-4b19214f7920a4dbb7acf42a4da667600d23bd6a.tar.gz gdb-4b19214f7920a4dbb7acf42a4da667600d23bd6a.tar.bz2 |
gdb/testsuite: reformat gdb.python/pretty-print-call-by-hand.py
Run black on the file.
Change-Id: Ifb576137fb7158a0227173f61c1202f0695b3685
-rw-r--r-- | gdb/testsuite/gdb.python/pretty-print-call-by-hand.py | 10 |
1 files 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 f8f5df6..5343af8 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) |