Skip to content

Commit 6b0d606

Browse files
Make the typed pointer const and add missing brackets
1 parent a1716ec commit 6b0d606

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/pretty-printers/gdb/pretty_printers.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ 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 = "((const {} *){})".format(self.val.type, raw_address.split(None, 1)[0])
2525

2626
# Check that the pointer is not null.
2727
if gdb.parse_and_eval(typed_pointer + " == 0"):

0 commit comments

Comments
 (0)