Skip to content

Commit 620738e

Browse files
authored
[lldb-dap][test] Fix readMemory test (llvm#109057)
So far, the test case was also testing the offset -1. This test cases failed if the string is immediately at the beginning of the memory region, though, and the offset -1 hence belonged to a different memory region. The fix is rather straightforward: Passing an offset of -1 is not used by any actual clients of lldb-dap, anyway. As such, this commit simply removes the corresponding test case.
1 parent a9d9b0a commit 620738e

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

lldb/test/API/tools/lldb-dap/memory/TestDAP_memory.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,6 @@ def test_memory_refs_set_variable(self):
7474
].keys(),
7575
)
7676

77-
# lldb-dap assumes that all reads will be within the same region. On Windows
78-
# the target string is at the very start of a region so the -1 offset causes
79-
# the read to only read from the previous region and only return 1 byte.
80-
@skipIfWindows
8177
def test_readMemory(self):
8278
"""
8379
Tests the 'readMemory' request
@@ -104,10 +100,6 @@ def test_readMemory(self):
104100
mem = self.dap_server.request_readMemory(memref, 2, 3)["body"]
105101
self.assertEqual(b64decode(mem["data"]), b"ad\0")
106102

107-
# Use a negative offset
108-
mem = self.dap_server.request_readMemory(memref, -1, 6)["body"]
109-
self.assertEqual(b64decode(mem["data"])[1:], b"dead\0")
110-
111103
# Reads of size 0 are successful
112104
# VS-Code sends those in order to check if a `memoryReference` can actually be dereferenced.
113105
mem = self.dap_server.request_readMemory(memref, 0, 0)

0 commit comments

Comments
 (0)