aboutsummaryrefslogtreecommitdiff
path: root/lldb/test/API/python_api
diff options
context:
space:
mode:
authorBruce Mitchener <bruce.mitchener@gmail.com>2021-06-04 15:29:34 +0700
committerBruce Mitchener <bruce.mitchener@gmail.com>2021-06-05 13:42:18 +0700
commit8d33437d030af27fff21dd3fd0e66893b0148217 (patch)
tree10b033d9bcdf235affe5f1d32aa98f781189fde6 /lldb/test/API/python_api
parent06e7de795bf19b950693b8dc86fa36f355dc6760 (diff)
downloadllvm-8d33437d030af27fff21dd3fd0e66893b0148217.zip
llvm-8d33437d030af27fff21dd3fd0e66893b0148217.tar.gz
llvm-8d33437d030af27fff21dd3fd0e66893b0148217.tar.bz2
[LLDB/API] Expose args and env from SBProcessInfo.
This is another step towards implementing the equivalent of `platform process list` and related functionality. `uint32_t` is used for the argument count and index despite the underlying value being `size_t` to be consistent with other index-based access to arguments. Differential Revision: https://reviews.llvm.org/D103675
Diffstat (limited to 'lldb/test/API/python_api')
-rw-r--r--lldb/test/API/python_api/process/TestProcessAPI.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/lldb/test/API/python_api/process/TestProcessAPI.py b/lldb/test/API/python_api/process/TestProcessAPI.py
index b7efc7e..5df9eb9 100644
--- a/lldb/test/API/python_api/process/TestProcessAPI.py
+++ b/lldb/test/API/python_api/process/TestProcessAPI.py
@@ -335,6 +335,8 @@ class ProcessAPITestCase(TestBase):
# Launch the process and stop at the entry point.
launch_info = target.GetLaunchInfo()
launch_info.SetWorkingDirectory(self.get_process_working_directory())
+ launch_info.SetEnvironmentEntries(["FOO=BAR"], False)
+ launch_info.SetArguments(["--abc"], False)
launch_flags = launch_info.GetLaunchFlags()
launch_flags |= lldb.eLaunchFlagStopAtEntry
launch_info.SetLaunchFlags(launch_flags)
@@ -358,6 +360,11 @@ class ProcessAPITestCase(TestBase):
"Process ID is valid")
triple = process_info.GetTriple()
self.assertIsNotNone(triple, "Process has a triple")
+ env = process_info.GetEnvironment()
+ self.assertGreater(env.GetNumValues(), 0)
+ self.assertEqual("BAR", env.Get("FOO"))
+ self.assertEqual(process_info.GetNumArguments(), 1)
+ self.assertEqual("--abc", process_info.GetArgumentAtIndex(0))
# Additional process info varies by platform, so just check that
# whatever info was retrieved is consistent and nothing blows up.