From 610dd028151c6045d8a64d1fa39541dbffef3bf3 Mon Sep 17 00:00:00 2001 From: eidheim Date: Sun, 25 Jun 2017 10:42:08 +0200 Subject: [PATCH] Fixed segmentation fault when running debug command on newer liblldb --- src/debug_lldb.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/debug_lldb.cc b/src/debug_lldb.cc index e698129..d88326c 100644 --- a/src/debug_lldb.cc +++ b/src/debug_lldb.cc @@ -314,8 +314,12 @@ std::pair Debug::LLDB::run_command(const std::string & if(state==lldb::StateType::eStateStopped || state==lldb::StateType::eStateRunning) { lldb::SBCommandReturnObject command_return_object; debugger->GetCommandInterpreter().HandleCommand(command.c_str(), command_return_object, true); - command_return.first=command_return_object.GetOutput(); - command_return.second=command_return_object.GetError(); + auto output=command_return_object.GetOutput(); + if(output) + command_return.first=output; + auto error=command_return_object.GetError(); + if(error) + command_return.second=error; } return command_return; }