[Lldb-commits] [lldb] r352709 - [Python] Fix gdb-remote and lldb-server utilities to work with Py3.
Davide Italiano via lldb-commits
lldb-commits at lists.llvm.org
Wed Jan 30 17:01:54 PST 2019
Author: davide
Date: Wed Jan 30 17:01:53 2019
New Revision: 352709
URL: http://llvm.org/viewvc/llvm-project?rev=352709&view=rev
Log:
[Python] Fix gdb-remote and lldb-server utilities to work with Py3.
Modified:
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/lldbgdbserverutils.py
Modified: lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py?rev=352709&r1=352708&r2=352709&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py Wed Jan 30 17:01:53 2019
@@ -589,7 +589,7 @@ class GdbRemoteTestCaseBase(TestBase):
if can_read and sock in can_read:
recv_bytes = sock.recv(4096)
if recv_bytes:
- response += recv_bytes
+ response += recv_bytes.decode("utf-8")
self.assertTrue(expected_content_regex.match(response))
@@ -600,7 +600,7 @@ class GdbRemoteTestCaseBase(TestBase):
while len(request_bytes_remaining) > 0 and time.time() < timeout_time:
_, can_write, _ = select.select([], [sock], [], timeout_seconds)
if can_write and sock in can_write:
- written_byte_count = sock.send(request_bytes_remaining)
+ written_byte_count = sock.send(request_bytes_remaining.encode())
request_bytes_remaining = request_bytes_remaining[
written_byte_count:]
self.assertEqual(len(request_bytes_remaining), 0)
@@ -611,7 +611,7 @@ class GdbRemoteTestCaseBase(TestBase):
# Send the start no ack mode packet.
NO_ACK_MODE_REQUEST = "$QStartNoAckMode#b0"
- bytes_sent = stub_socket.send(NO_ACK_MODE_REQUEST)
+ bytes_sent = stub_socket.send(NO_ACK_MODE_REQUEST.encode())
self.assertEqual(bytes_sent, len(NO_ACK_MODE_REQUEST))
# Receive the ack and "OK"
Modified: lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/lldbgdbserverutils.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/lldbgdbserverutils.py?rev=352709&r1=352708&r2=352709&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/lldbgdbserverutils.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/lldbgdbserverutils.py Wed Jan 30 17:01:53 2019
@@ -221,7 +221,7 @@ def expect_lldb_gdbserver_replay(
packet_desc = send_packet
logger.info(
"sending packet to remote: {}".format(packet_desc))
- sock.sendall(send_packet)
+ sock.sendall(send_packet.encode())
else:
# This is an entry expecting to receive content from the remote
# debug monitor.
@@ -921,7 +921,7 @@ def process_is_running(pid, unknown_valu
elif platform.system() in ['Darwin', 'Linux', 'FreeBSD', 'NetBSD']:
# Build the list of running process ids
output = subprocess.check_output(
- "ps ax | awk '{ print $1; }'", shell=True)
+ "ps ax | awk '{ print $1; }'", shell=True).decode("utf-8")
text_process_ids = output.split('\n')[1:]
# Convert text pids to ints
process_ids = [int(text_pid)
More information about the lldb-commits
mailing list