diff options
author | Bruno Larsen <blarsen@redhat.com> | 2022-10-11 11:22:37 +0200 |
---|---|---|
committer | Bruno Larsen <blarsen@redhat.com> | 2022-10-11 11:22:37 +0200 |
commit | 73fa80feee65dde8cbbdacca1b76b4f3f6af62cb (patch) | |
tree | 1233b6eb71f6fead5a1ba81f3c7c02b57349bf5e /gdb/testsuite/gdb.python | |
parent | 86b4a00fa329a4df7ec2cb404c2b52152560aa0f (diff) | |
download | gdb-73fa80feee65dde8cbbdacca1b76b4f3f6af62cb.zip gdb-73fa80feee65dde8cbbdacca1b76b4f3f6af62cb.tar.gz gdb-73fa80feee65dde8cbbdacca1b76b4f3f6af62cb.tar.bz2 |
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.
Diffstat (limited to 'gdb/testsuite/gdb.python')
-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) |