diff options
| author | Raphael Isemann <teemperor@gmail.com> | 2022-11-17 00:52:02 +0100 |
|---|---|---|
| committer | Raphael Isemann <teemperor@gmail.com> | 2022-11-18 16:48:56 +0100 |
| commit | a8bec6117998cd4a9ff6798381cd0df9c9edb982 (patch) | |
| tree | 085c0c7aa9a813988d49298178ca8d79272fd449 /lldb/test/API/python_api | |
| parent | 3ae3162cb66ffc14eb1b500484952936651d3c9f (diff) | |
| download | llvm-a8bec6117998cd4a9ff6798381cd0df9c9edb982.zip llvm-a8bec6117998cd4a9ff6798381cd0df9c9edb982.tar.gz llvm-a8bec6117998cd4a9ff6798381cd0df9c9edb982.tar.bz2 | |
[lldb] Fix that empty target.run-args are not actually used when launching process
`GetPropertyAtIndexAsArgs` returns true on success and false on failure. Right
now it returns the converted `size_t` returned from `GetArgs` which describes
the number of arguments in the argument list. So for empty argument lists
(`(size_t)0` -> `(bool)false`) this function always fails.
The only observable effect of this seems to be that empty arguments are never
propagated to the internal LaunchInfo for a process. This causes that once any
argument has been added to `target.run-args`, clearing `target.run-args` doesn't
have any effect.
Fixes issue #55568
Reviewed By: JDevlieghere, jingham
Differential Revision: https://reviews.llvm.org/D126057
Diffstat (limited to 'lldb/test/API/python_api')
| -rw-r--r-- | lldb/test/API/python_api/target/TestTargetAPI.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lldb/test/API/python_api/target/TestTargetAPI.py b/lldb/test/API/python_api/target/TestTargetAPI.py index 0b25144..f1a379b 100644 --- a/lldb/test/API/python_api/target/TestTargetAPI.py +++ b/lldb/test/API/python_api/target/TestTargetAPI.py @@ -191,6 +191,15 @@ class TargetAPITestCase(TestBase): self.assertIn('arg: foo', output) self.assertIn('env: bar=baz', output) + # Clear all the run args set above. + self.runCmd("setting clear target.run-args") + process = target.LaunchSimple(None, None, + self.get_process_working_directory()) + process.Continue() + self.assertEqual(process.GetState(), lldb.eStateExited) + output = process.GetSTDOUT(9999) + self.assertNotIn('arg: foo', output) + self.runCmd("settings set target.disable-stdio true") process = target.LaunchSimple( None, None, self.get_process_working_directory()) |
