Skip to content

Commit 9c71c2e

Browse files
committed
Remove the restriction that backend commands can only be executed when a target is running
1 parent fd67715 commit 9c71c2e

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

core/adapters/dbgengadapter.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -998,9 +998,12 @@ uint64_t DbgEngAdapter::ExitCode()
998998

999999
std::string DbgEngAdapter::InvokeBackendCommand(const std::string& command)
10001000
{
1001-
this->m_debugControl->Execute(DEBUG_OUTCTL_ALL_CLIENTS, command.c_str(), DEBUG_EXECUTE_NO_REPEAT);
1002-
m_debugClient->ExitDispatch(reinterpret_cast<PDEBUG_CLIENT>(m_debugClient));
1003-
// The output is handled by DbgEngOutputCallbacks::Output()
1001+
if (m_debugControl)
1002+
{
1003+
this->m_debugControl->Execute(DEBUG_OUTCTL_ALL_CLIENTS, command.c_str(), DEBUG_EXECUTE_NO_REPEAT);
1004+
m_debugClient->ExitDispatch(reinterpret_cast<PDEBUG_CLIENT>(m_debugClient));
1005+
// The output is handled by DbgEngOutputCallbacks::Output()
1006+
}
10041007
return "";
10051008
}
10061009

core/debuggercontroller.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1140,11 +1140,10 @@ void DebuggerController::WriteStdIn(const std::string message)
11401140

11411141
std::string DebuggerController::InvokeBackendCommand(const std::string &cmd)
11421142
{
1143-
if (m_adapter && m_state->IsConnected())
1144-
{
1143+
if (m_adapter)
11451144
return m_adapter->InvokeBackendCommand(cmd);
1146-
}
1147-
return "Error: target is not running yet\n";
1145+
1146+
return "Error: invalid adapter\n";
11481147
}
11491148

11501149

0 commit comments

Comments
 (0)