Skip to content

Commit a1716ec

Browse files
Make quotation marks consistent
1 parent e91cbdc commit a1716ec

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

scripts/pretty-printers/gdb/pretty_printers.py

+10-10
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,20 @@ def to_string(self):
2121

2222
# Split the address on the first space, return that value
2323
# Addresses are usually {address} {optional type_name}
24-
typed_pointer = '({}*){}'.format(self.val.type, raw_address.split(None, 1)[0])
24+
typed_pointer = "({}*){}".format(self.val.type, raw_address.split(None, 1)[0])
2525

2626
# Check that the pointer is not null.
27-
if gdb.parse_and_eval(typed_pointer + ' == 0'):
27+
if gdb.parse_and_eval(typed_pointer + " == 0"):
2828
return ""
2929

3030
# If it isn't attempt to find the string.
31-
value = '(*{})'.format(typed_pointer)
32-
return gdb.parse_and_eval(value + '.c_str()')
31+
value = "(*{})".format(typed_pointer)
32+
return gdb.parse_and_eval(value + ".c_str()")
3333
except:
3434
return ""
3535

3636
def display_hint(self):
37-
return 'string'
37+
return "string"
3838

3939

4040
class InstructionPrettyPrinter:
@@ -44,14 +44,14 @@ def __init__(self, val):
4444
def to_string(self):
4545
try:
4646
raw_address = str(self.val.address)
47-
variable_accessor = '(*({}*){})'.format(self.val.type, raw_address.split(None, 1)[0])
48-
expr = '{0}.to_string()'.format(variable_accessor)
47+
variable_accessor = "(*({}*){})".format(self.val.type, raw_address.split(None, 1)[0])
48+
expr = "{0}.to_string()".format(variable_accessor)
4949
return gdb.parse_and_eval(expr)
5050
except:
5151
return ""
5252

5353
def display_hint(self):
54-
return 'string'
54+
return "string"
5555

5656

5757
# If you change the name of this make sure to change install.py too.
@@ -60,7 +60,7 @@ def load_cbmc_printers():
6060

6161
# First argument is the name of the pretty-printer, second is a regex match for which type
6262
# it should be applied too, third is the class that should be called to pretty-print that type.
63-
printers.add_printer('dstringt', '^(?:dstringt|irep_idt)', DStringPrettyPrinter)
64-
printers.add_printer('instructiont', '^goto_programt::instructiont', InstructionPrettyPrinter)
63+
printers.add_printer("dstringt", "^(?:dstringt|irep_idt)", DStringPrettyPrinter)
64+
printers.add_printer("instructiont", "^goto_programt::instructiont", InstructionPrettyPrinter)
6565
# We aren't associating with a particular object file, so pass in None instead of gdb.current_objfile()
6666
gdb.printing.register_pretty_printer(None, printers, replace=True)

0 commit comments

Comments
 (0)