Debugger: Fix crash in breakpoint view

... when double-clicking on an entry for which debug information
but no corresponding sources were found.

Change-Id: I48f57794e072752d444d7c3ccd8bfe517c9db1dd
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
This commit is contained in:
hjk
2015-05-18 11:09:17 +02:00
parent b448651877
commit 9edbd01922

View File

@@ -1182,11 +1182,14 @@ void Breakpoint::gotoLocation() const
if (b->m_params.type == BreakpointByAddress) {
engine->gotoLocation(b->m_params.address);
} else {
// Don't use gotoLocation as this ends up in disassembly
// if OperateByInstruction is on.
// Don't use gotoLocation unconditionally as this ends up in
// disassembly if OperateByInstruction is on. But fallback
// to disassembly if we can't open the file.
const QString file = QDir::cleanPath(b->markerFileName());
IEditor *editor = EditorManager::openEditor(file);
editor->gotoLine(b->markerLineNumber(), 0);
if (IEditor *editor = EditorManager::openEditor(file))
editor->gotoLine(b->markerLineNumber(), 0);
else
engine->openDisassemblerView(Location(b->m_response.address));
}
}
}