Commit eea8e932 authored by hjk's avatar hjk

Debugger: Fix jump to file/line breakpoint from disassembler

Triggered by double-clicking a normal source file+line breakpoint
while looking at some disassembly: We want to jump to the original
source file in that case.

Change-Id: Ia6eddcaf27e4160c7a989ab757315f5314f65d1e
Reviewed-by: default avatarChristian Stenger <christian.stenger@theqtcompany.com>
parent f6078088
......@@ -33,11 +33,18 @@
#include "debuggeractions.h"
#include "debuggercore.h"
#include "debuggerengine.h"
#include "debuggerinternalconstants.h"
#include "debuggerstringutils.h"
#include "simplifytype.h"
#include <coreplugin/coreconstants.h>
#include <coreplugin/coreplugin.h>
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/idocument.h>
#include <extensionsystem/invoker.h>
#include <texteditor/textmark.h>
#include <texteditor/texteditor.h>
#include <utils/hostosinfo.h>
#include <utils/qtcassert.h>
#include <utils/fileutils.h>
......@@ -50,6 +57,7 @@
#include <QDir>
#include <QDebug>
using namespace Core;
using namespace Utils;
namespace Debugger {
......@@ -1171,10 +1179,15 @@ void BreakHandler::timerEvent(QTimerEvent *event)
void Breakpoint::gotoLocation() const
{
if (DebuggerEngine *engine = currentEngine()) {
if (b->m_params.type == BreakpointByAddress)
if (b->m_params.type == BreakpointByAddress) {
engine->gotoLocation(b->m_params.address);
else
engine->gotoLocation(Location(b->markerFileName(), b->markerLineNumber(), false));
} else {
// Don't use gotoLocation as this ends up in disassembly
// if OperateByInstruction is on.
const QString file = QDir::cleanPath(b->markerFileName());
IEditor *editor = EditorManager::openEditor(file);
editor->gotoLine(b->markerLineNumber(), 0);
}
}
}
......
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