Skip to content

Commit

Permalink
gdb/testsuite: Fix formatting of python script
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
GwenTheKween committed Oct 11, 2022
1 parent 86b4a00 commit 73fa80f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions gdb/testsuite/gdb.python/pretty-print-call-by-hand.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,25 @@ def __init__(self, val):
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)

0 comments on commit 73fa80f

Please sign in to comment.