forked from OSchip/llvm-project
[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
This commit is contained in:
parent
1f60e2b41b
commit
cc92f5038e
|
@ -0,0 +1,6 @@
|
|||
# RUN: %lldbmi < %s | FileCheck %s
|
||||
|
||||
# Test that -exec-run command won't hang in case of wrong name of binary file.
|
||||
|
||||
-file-exec-and-symbols name.exe
|
||||
# CHECK: ^error,msg="Command 'file-exec-and-symbols'. Target binary 'name.exe' is invalid.
|
|
@ -0,0 +1 @@
|
|||
config.suffixes = ['.test']
|
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue