summaryrefslogtreecommitdiff
path: root/lldb/test/Shell/Commands/CommandScriptImmediateOutput/CommandScriptImmediateOutputFile.test
diff options
context:
space:
mode:
authorDavid Peixotto <peix@meta.com>2025-11-21 08:44:08 -0800
committerGitHub <noreply@github.com>2025-11-21 08:44:08 -0800
commite724009f2f449dfcfb44c29f39872b56f6a85af1 (patch)
treee0606ad368de07ed48f53d2f0dcca91523825968 /lldb/test/Shell/Commands/CommandScriptImmediateOutput/CommandScriptImmediateOutputFile.test
parent01227abf8d0f2c4f8d0718354dab2e8ddca8640e (diff)
[lldb] Add MockMemory class for dwarf expression testing (#168467)
This change unifies the way that we specify mocked memory to make it easy to control the process and target memory contents for unit tests. We add a MockMemory class that can be used in dwarf expression testing to specify the output of the `ReadMemory` function. The MockMemory class is built on a map that maps a `(address, size)` pair to a vector of bytes that is `size` bytes long and contains the memory contents for that `address`. The MockProcessWithMemRead and MockTarget classes are updated to use the new MockMemory interface. The MockProcessWithMemRead class was renamed to MockProcess and the old MockProcess was deleted. The old MockProcess had and ReadMemory implementation that returned the value `i & 0xff` for reading the address `i` and was easily be replaced with the MockMemory object. The CreateTestContext function now takes optional values for process memory and target memory and uses those to create the mock objects.
Diffstat (limited to 'lldb/test/Shell/Commands/CommandScriptImmediateOutput/CommandScriptImmediateOutputFile.test')
0 files changed, 0 insertions, 0 deletions