aboutsummaryrefslogtreecommitdiff
path: root/lldb/test/API/python_api
diff options
context:
space:
mode:
authorPavel Labath <pavel@labath.sk>2024-09-25 08:31:42 +0200
committerGitHub <noreply@github.com>2024-09-25 08:31:42 +0200
commitdf6822f4eb81638e724f09b948b83fe678412d25 (patch)
tree245e509e33f7b0f2c55516ebcb13309e1f6fa336 /lldb/test/API/python_api
parenta6ea0b0d2973d3d94f9ed7aac6db9ca722664774 (diff)
downloadllvm-df6822f4eb81638e724f09b948b83fe678412d25.zip
llvm-df6822f4eb81638e724f09b948b83fe678412d25.tar.gz
llvm-df6822f4eb81638e724f09b948b83fe678412d25.tar.bz2
[lldb] Fix error reporting in SBTarget::ReadMemory (#109764)
The function should use the by-ref SBError argument instead of creating a new one. This code has been here since ~forever, and was probably copied from methods which return an SBError result (where one needs to create a local variable).
Diffstat (limited to 'lldb/test/API/python_api')
-rw-r--r--lldb/test/API/python_api/target/TestTargetAPI.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/lldb/test/API/python_api/target/TestTargetAPI.py b/lldb/test/API/python_api/target/TestTargetAPI.py
index 2e8d6a5..155a25b 100644
--- a/lldb/test/API/python_api/target/TestTargetAPI.py
+++ b/lldb/test/API/python_api/target/TestTargetAPI.py
@@ -153,6 +153,11 @@ class TargetAPITestCase(TestBase):
self.assertSuccess(error, "Make sure memory read succeeded")
self.assertEqual(len(content), 1)
+ # Make sure reading from 0x0 fails
+ sb_addr = lldb.SBAddress(0, target)
+ self.assertIsNone(target.ReadMemory(sb_addr, 1, error))
+ self.assertTrue(error.Fail())
+
@skipIfWindows # stdio manipulation unsupported on Windows
@skipIfRemote # stdio manipulation unsupported on remote iOS devices<rdar://problem/54581135>
@skipIf(oslist=["linux"], archs=["arm", "aarch64"])