summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/ScriptInterpreter/Python
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python')
-rw-r--r--lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
index e115057db8c..12cadff9351 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
@@ -753,6 +753,8 @@ static void ReadThreadBytesReceived(void *baton, const void *src,
bool ScriptInterpreterPython::ExecuteOneLine(
llvm::StringRef command, CommandReturnObject *result,
const ExecuteScriptOptions &options) {
+ std::string command_str = command.str();
+
if (!m_valid_session)
return false;
@@ -855,7 +857,7 @@ bool ScriptInterpreterPython::ExecuteOneLine(
if (PyCallable_Check(m_run_one_line_function.get())) {
PythonObject pargs(
PyRefType::Owned,
- Py_BuildValue("(Os)", session_dict.get(), command));
+ Py_BuildValue("(Os)", session_dict.get(), command_str.c_str()));
if (pargs.IsValid()) {
PythonObject return_value(
PyRefType::Owned,
@@ -895,7 +897,6 @@ bool ScriptInterpreterPython::ExecuteOneLine(
// The one-liner failed. Append the error message.
if (result) {
- std::string command_str = command.str();
result->AppendErrorWithFormat(
"python failed attempting to evaluate '%s'\n", command_str.c_str());
}
OpenPOWER on IntegriCloud