diff options
| author | Alexander Polyakov <polyakov.alx@gmail.com> | 2018-06-03 15:15:23 +0000 |
|---|---|---|
| committer | Alexander Polyakov <polyakov.alx@gmail.com> | 2018-06-03 15:15:23 +0000 |
| commit | cc92f5038e7c1070e1ab4271d114ea0baade5416 (patch) | |
| tree | 04aea2a5439be90de8b32b3129349550858bdfc6 /lldb/tools/lldb-mi | |
| parent | 1f60e2b41b0b274fccf98e26bbd1eb600af1f167 (diff) | |
| download | bcm5719-llvm-cc92f5038e7c1070e1ab4271d114ea0baade5416.tar.gz bcm5719-llvm-cc92f5038e7c1070e1ab4271d114ea0baade5416.zip | |
[lldb, lldm-mi] Fix hanging of -exec-run command.
Summary: -exec-run command hanged in case of invalid or dummy target.
Reviewers: aprantl, stella.stamenova
Reviewed By: aprantl
Subscribers: ki.stfu, llvm-commits, lldb-commits
Differential Revision: https://reviews.llvm.org/D47678
llvm-svn: 333844
Diffstat (limited to 'lldb/tools/lldb-mi')
| -rw-r--r-- | lldb/tools/lldb-mi/MICmdCmdExec.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lldb/tools/lldb-mi/MICmdCmdExec.cpp b/lldb/tools/lldb-mi/MICmdCmdExec.cpp index 8fa63f4d98e..4a6f40b26d4 100644 --- a/lldb/tools/lldb-mi/MICmdCmdExec.cpp +++ b/lldb/tools/lldb-mi/MICmdCmdExec.cpp @@ -99,6 +99,19 @@ bool CMICmdCmdExecRun::ParseArgs() { bool CMICmdCmdExecRun::Execute() { CMICmnLLDBDebugSessionInfo &rSessionInfo( CMICmnLLDBDebugSessionInfo::Instance()); + + { + // Check we have a valid target. + // Note: target created via 'file-exec-and-symbols' command. + lldb::SBTarget sbTarget = rSessionInfo.GetTarget(); + if (!sbTarget.IsValid() || + sbTarget == rSessionInfo.GetDebugger().GetDummyTarget()) { + SetError(CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_INVALID_TARGET_CURRENT), + m_cmdData.strMiCmd.c_str())); + return MIstatus::failure; + } + } + lldb::SBError error; lldb::SBStream errMsg; lldb::SBLaunchInfo launchInfo = rSessionInfo.GetTarget().GetLaunchInfo(); |

