Debugger: Avoid crash when attach to process fails

If attaching to the current's project running executable fails due
crashing inferior the run tool is cleaned up already when trying to
fetch its run parameters.
Circumvent by checking whether run tool is still accessible.

Change-Id: I56f3d841d77d0513806a2b91357841f160f74ed3
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Christian Stenger
2017-07-26 09:33:26 +02:00
parent 9030e34dea
commit d68f258754

View File

@@ -4034,7 +4034,10 @@ void GdbEngine::reloadDebuggingHelpers()
void GdbEngine::handleGdbError(QProcess::ProcessError error)
{
QString program = runParameters().debugger.executable;
QString program;
// avoid accessing invalid memory if the process crashed
if (runTool())
program = runParameters().debugger.executable;
QString msg = RunWorker::userMessageForProcessError(error, program);
QString errorString = m_gdbProc.errorString();
if (!errorString.isEmpty())