gdb: Fix range printer for singular ranges

Before, it printed [x, +inf) instead of {x}
This commit is contained in:
Tomasz Grabiec
2024-09-16 16:43:18 +02:00
parent a4a8cad97f
commit 2c463ead59

View File

@@ -1248,6 +1248,9 @@ class interval_printer(gdb.printing.PrettyPrinter):
has_start, start_inclusive, start_value = self.inspect_bound(self.val['_start'])
has_end, end_inclusive, end_value = self.inspect_bound(self.val['_end'])
if self.val['_singular']:
return '{{{}}}'.format(str(start_value))
return '{}{}, {}{}'.format(
'[' if start_inclusive else '(',
str(start_value) if has_start else '-inf',