mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-19 17:18:24 +08:00
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.
This commit is contained in:
@ -21,21 +21,25 @@ class MytypePrinter:
|
|||||||
self.val = val
|
self.val = val
|
||||||
|
|
||||||
def to_string(self):
|
def to_string(self):
|
||||||
calls = gdb.parse_and_eval('f()')
|
calls = gdb.parse_and_eval("f()")
|
||||||
return "mytype is %s" % self.val['x']
|
return "mytype is %s" % self.val["x"]
|
||||||
|
|
||||||
|
|
||||||
def ec_lookup_function(val):
|
def ec_lookup_function(val):
|
||||||
typ = val.type
|
typ = val.type
|
||||||
if typ.code == gdb.TYPE_CODE_REF:
|
if typ.code == gdb.TYPE_CODE_REF:
|
||||||
typ = typ.target()
|
typ = typ.target()
|
||||||
if str(typ) == 'struct mytype':
|
if str(typ) == "struct mytype":
|
||||||
return MytypePrinter(val)
|
return MytypePrinter(val)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
def disable_lookup_function():
|
def disable_lookup_function():
|
||||||
ec_lookup_function.enabled = False
|
ec_lookup_function.enabled = False
|
||||||
|
|
||||||
|
|
||||||
def enable_lookup_function():
|
def enable_lookup_function():
|
||||||
ec_lookup_function.enabled = True
|
ec_lookup_function.enabled = True
|
||||||
|
|
||||||
|
|
||||||
gdb.pretty_printers.append(ec_lookup_function)
|
gdb.pretty_printers.append(ec_lookup_function)
|
||||||
|
Reference in New Issue
Block a user