Commit d68f2587 authored by Christian Stenger's avatar Christian Stenger
Browse files

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's avatarOrgad Shaneh <orgads@gmail.com>
parent 9030e34d
......@@ -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())
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment