summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/tools/lldb-server/TestLldbGdbServer.py
diff options
context:
space:
mode:
authorPavel Labath <labath@google.com>2016-08-18 08:21:42 +0000
committerPavel Labath <labath@google.com>2016-08-18 08:21:42 +0000
commitc233995b1e2b514a4366248827e904e3c37e7582 (patch)
tree9e355d5ef817103b0987529b25f2fb7bdc0bcb02 /lldb/packages/Python/lldbsuite/test/tools/lldb-server/TestLldbGdbServer.py
parent9361c439e8cef6fcc87edefbc3389ad1160984fd (diff)
downloadbcm5719-llvm-c233995b1e2b514a4366248827e904e3c37e7582.tar.gz
bcm5719-llvm-c233995b1e2b514a4366248827e904e3c37e7582.zip
Fix tests for the gdb-remote memory read packets
Part of TestGDBRemoteMemoryRead has been disabled since r259379 because it was incompatible with python3. This changes the test to use the lldb-server test framework, which is a more appropriate method of testing raw stub behaviour anyway (and should avoid the whole python 3 issue). llvm-svn: 279039
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/tools/lldb-server/TestLldbGdbServer.py')
-rw-r--r--lldb/packages/Python/lldbsuite/test/tools/lldb-server/TestLldbGdbServer.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-server/TestLldbGdbServer.py b/lldb/packages/Python/lldbsuite/test/tools/lldb-server/TestLldbGdbServer.py
index 201ff2c63a8..b60d08dc136 100644
--- a/lldb/packages/Python/lldbsuite/test/tools/lldb-server/TestLldbGdbServer.py
+++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-server/TestLldbGdbServer.py
@@ -1309,11 +1309,20 @@ class LldbGdbServerTestCase(gdbremote_testcase.GdbRemoteTestCaseBase):
# Hex-encode the test message, adding null termination.
hex_encoded_message = TEST_MESSAGE.encode("hex")
- # Write the message to the inferior.
+ # Write the message to the inferior. Verify that we can read it with the hex-encoded (m)
+ # and binary (x) memory read packets.
self.reset_test_sequence()
self.test_sequence.add_log_lines(
- ["read packet: $M{0:x},{1:x}:{2}#00".format(message_address, len(hex_encoded_message)/2, hex_encoded_message),
+ ["read packet: $M{0:x},{1:x}:{2}#00".format(message_address, len(TEST_MESSAGE), hex_encoded_message),
"send packet: $OK#00",
+ "read packet: $m{0:x},{1:x}#00".format(message_address, len(TEST_MESSAGE)),
+ "send packet: ${0}#00".format(hex_encoded_message),
+ "read packet: $x{0:x},{1:x}#00".format(message_address, len(TEST_MESSAGE)),
+ "send packet: ${0}#00".format(TEST_MESSAGE),
+ "read packet: $m{0:x},4#00".format(message_address),
+ "send packet: ${0}#00".format(hex_encoded_message[0:8]),
+ "read packet: $x{0:x},4#00".format(message_address),
+ "send packet: ${0}#00".format(TEST_MESSAGE[0:4]),
"read packet: $c#63",
{ "type":"output_match", "regex":r"^message: (.+)\r\n$", "capture":{ 1:"printed_message"} },
"send packet: $W00#00",
OpenPOWER on IntegriCloud