diff --git a/lldb/source/Interpreter/OptionValueProperties.cpp b/lldb/source/Interpreter/OptionValueProperties.cpp --- a/lldb/source/Interpreter/OptionValueProperties.cpp +++ b/lldb/source/Interpreter/OptionValueProperties.cpp @@ -248,16 +248,22 @@ return false; const OptionValueArgs *arguments = value->GetAsArgs(); - if (arguments) - return arguments->GetArgs(args); + if (arguments) { + arguments->GetArgs(args); + return true; + } const OptionValueArray *array = value->GetAsArray(); - if (array) - return array->GetArgs(args); + if (array) { + array->GetArgs(args); + return true; + } const OptionValueDictionary *dict = value->GetAsDictionary(); - if (dict) - return dict->GetArgs(args); + if (dict) { + dict->GetArgs(args); + return true; + } return false; } diff --git a/lldb/test/API/python_api/target/TestTargetAPI.py b/lldb/test/API/python_api/target/TestTargetAPI.py --- a/lldb/test/API/python_api/target/TestTargetAPI.py +++ b/lldb/test/API/python_api/target/TestTargetAPI.py @@ -191,6 +191,15 @@ 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())