summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authorhjk <hjk@theqtcompany.com>2015-04-17 11:19:58 +0200
committerhjk <hjk@theqtcompany.com>2015-04-27 07:30:12 +0000
commiteea8e932f3c3ca9157d961d57c80c5f297dff5c8 (patch)
treeaf27b477f1757be087daa61bcb755a4744cc42f2 /src/plugins
parentf60780881bdfcdcc705655cdcff3ab93b098866f (diff)
downloadqt-creator-eea8e932f3c3ca9157d961d57c80c5f297dff5c8.tar.gz
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>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/debugger/breakhandler.cpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/plugins/debugger/breakhandler.cpp b/src/plugins/debugger/breakhandler.cpp
index ee60ba1062..2334e452be 100644
--- a/src/plugins/debugger/breakhandler.cpp
+++ b/src/plugins/debugger/breakhandler.cpp
@@ -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);
+ }
}
}