Skip to content
Snippets Groups Projects
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: default avatarOrgad Shaneh <orgads@gmail.com>
parent 9030e34d
Branches
Tags
No related merge requests found
...@@ -4034,7 +4034,10 @@ void GdbEngine::reloadDebuggingHelpers() ...@@ -4034,7 +4034,10 @@ void GdbEngine::reloadDebuggingHelpers()
void GdbEngine::handleGdbError(QProcess::ProcessError error) 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 msg = RunWorker::userMessageForProcessError(error, program);
QString errorString = m_gdbProc.errorString(); QString errorString = m_gdbProc.errorString();
if (!errorString.isEmpty()) if (!errorString.isEmpty())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment