forked from qt-creator/qt-creator
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: Christian Stenger <christian.stenger@theqtcompany.com>
This commit is contained in:
@@ -33,11 +33,18 @@
|
|||||||
#include "debuggeractions.h"
|
#include "debuggeractions.h"
|
||||||
#include "debuggercore.h"
|
#include "debuggercore.h"
|
||||||
#include "debuggerengine.h"
|
#include "debuggerengine.h"
|
||||||
|
#include "debuggerinternalconstants.h"
|
||||||
#include "debuggerstringutils.h"
|
#include "debuggerstringutils.h"
|
||||||
#include "simplifytype.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 <extensionsystem/invoker.h>
|
||||||
#include <texteditor/textmark.h>
|
#include <texteditor/textmark.h>
|
||||||
|
#include <texteditor/texteditor.h>
|
||||||
#include <utils/hostosinfo.h>
|
#include <utils/hostosinfo.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
#include <utils/fileutils.h>
|
#include <utils/fileutils.h>
|
||||||
@@ -50,6 +57,7 @@
|
|||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
|
using namespace Core;
|
||||||
using namespace Utils;
|
using namespace Utils;
|
||||||
|
|
||||||
namespace Debugger {
|
namespace Debugger {
|
||||||
@@ -1171,10 +1179,15 @@ void BreakHandler::timerEvent(QTimerEvent *event)
|
|||||||
void Breakpoint::gotoLocation() const
|
void Breakpoint::gotoLocation() const
|
||||||
{
|
{
|
||||||
if (DebuggerEngine *engine = currentEngine()) {
|
if (DebuggerEngine *engine = currentEngine()) {
|
||||||
if (b->m_params.type == BreakpointByAddress)
|
if (b->m_params.type == BreakpointByAddress) {
|
||||||
engine->gotoLocation(b->m_params.address);
|
engine->gotoLocation(b->m_params.address);
|
||||||
else
|
} else {
|
||||||
engine->gotoLocation(Location(b->markerFileName(), b->markerLineNumber(), false));
|
// 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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user