Fix get_highlight_source line splitting

TL;DR: With .splitlines() we splitted over universal splitlines which did not correspond to GDB's target code line splitting...

As a result we got `context code` to produce bogus out of sync lines that didn't correspond to GDB's `line` command.

See also https://docs.python.org/3/library/stdtypes.html#str.splitlines
pull/964/head
Disconnect3d 4 years ago
parent 8cc218f0b8
commit f11afe2c68

@ -457,7 +457,7 @@ def get_highlight_source(filename):
if pwndbg.config.syntax_highlight: if pwndbg.config.syntax_highlight:
source = H.syntax_highlight(source, filename) source = H.syntax_highlight(source, filename)
source_lines = source.splitlines() source_lines = source.split('\n')
source_lines = tuple(line.rstrip() for line in source_lines) source_lines = tuple(line.rstrip() for line in source_lines)
return source_lines return source_lines

Loading…
Cancel
Save