Skip to content

Commit 9d896a2

Browse files
committed
Make sure we only split 1 time on '-->' or '<--' when replaying a log file.
1 parent c148dad commit 9d896a2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -729,15 +729,17 @@ def replay_packets(self, file: pathlib.Path, verbosity: int) -> None:
729729
with open(file, "r") as f:
730730
for line in f:
731731
if "-->" in line:
732-
command_dict = json.loads(line.split("--> ")[1])
732+
packet = line.split("--> ", maxsplit=1)[1]
733+
command_dict = json.loads(packet)
733734
if verbosity > 0:
734735
print("Sending:")
735736
pprint.PrettyPrinter(indent=2).pprint(command_dict)
736737
seq = self.send_packet(command_dict)
737738
if command_dict["type"] == "request":
738739
inflight[seq] = command_dict
739740
elif "<--" in line:
740-
replay_response = json.loads(line.split("<-- ")[1])
741+
packet = line.split("<-- ", maxsplit=1)[1]
742+
replay_response = json.loads(packet)
741743
print("Replay response:")
742744
pprint.PrettyPrinter(indent=2).pprint(replay_response)
743745
actual_response = self._recv_packet(

0 commit comments

Comments
 (0)