[Lldb-commits] [lldb] [lldb-dap][test] Fix `readMemory` test (PR #109057)
via lldb-commits
lldb-commits at lists.llvm.org
Tue Sep 17 15:25:50 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-lldb
Author: Adrian Vogelsgesang (vogelsgesang)
<details>
<summary>Changes</summary>
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.
---
Full diff: https://github.com/llvm/llvm-project/pull/109057.diff
1 Files Affected:
- (modified) lldb/test/API/tools/lldb-dap/memory/TestDAP_memory.py (-8)
``````````diff
diff --git a/lldb/test/API/tools/lldb-dap/memory/TestDAP_memory.py b/lldb/test/API/tools/lldb-dap/memory/TestDAP_memory.py
index 3d8aaeda7f4b85..1082541aebcf7c 100644
--- a/lldb/test/API/tools/lldb-dap/memory/TestDAP_memory.py
+++ b/lldb/test/API/tools/lldb-dap/memory/TestDAP_memory.py
@@ -74,10 +74,6 @@ def test_memory_refs_set_variable(self):
].keys(),
)
- # lldb-dap assumes that all reads will be within the same region. On Windows
- # the target string is at the very start of a region so the -1 offset causes
- # the read to only read from the previous region and only return 1 byte.
- @skipIfWindows
def test_readMemory(self):
"""
Tests the 'readMemory' request
@@ -104,10 +100,6 @@ def test_readMemory(self):
mem = self.dap_server.request_readMemory(memref, 2, 3)["body"]
self.assertEqual(b64decode(mem["data"]), b"ad\0")
- # Use a negative offset
- mem = self.dap_server.request_readMemory(memref, -1, 6)["body"]
- self.assertEqual(b64decode(mem["data"])[1:], b"dead\0")
-
# Reads of size 0 are successful
# VS-Code sends those in order to check if a `memoryReference` can actually be dereferenced.
mem = self.dap_server.request_readMemory(memref, 0, 0)
``````````
</details>
https://github.com/llvm/llvm-project/pull/109057
More information about the lldb-commits
mailing list