summaryrefslogtreecommitdiff
path: root/src/plugins/debugger/sourceutils.cpp
diff options
context:
space:
mode:
authorhjk <hjk@theqtcompany.com>2015-07-17 16:33:25 +0200
committerhjk <hjk@theqtcompany.com>2015-07-21 07:38:19 +0000
commitdb80d20f30a6fa4973c849fca10b4e6040ecc646 (patch)
treec8a662bf6e317e30400af89f111d909b5acea20b /src/plugins/debugger/sourceutils.cpp
parentff63fd113a4ff6bc91a2fbb985fbd99254a6cdef (diff)
downloadqt-creator-db80d20f30a6fa4973c849fca10b4e6040ecc646.tar.gz
Debugger: Restrict LocationMark dragging
... to engines that actually support JumpToLine and make it work in disassembler views. Change-Id: I10368ea719587caa7c4f33665eff57c2bf300d84 Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Diffstat (limited to 'src/plugins/debugger/sourceutils.cpp')
-rw-r--r--src/plugins/debugger/sourceutils.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/plugins/debugger/sourceutils.cpp b/src/plugins/debugger/sourceutils.cpp
index e70696ccc5..5da06340b4 100644
--- a/src/plugins/debugger/sourceutils.cpp
+++ b/src/plugins/debugger/sourceutils.cpp
@@ -30,6 +30,9 @@
#include "sourceutils.h"
+#include "debuggerinternalconstants.h"
+#include "debuggerengine.h"
+#include "disassemblerlines.h"
#include "watchdata.h"
#include "watchutils.h"
@@ -333,5 +336,19 @@ QString fixCppExpression(const QString &expIn)
return removeObviousSideEffects(exp);
}
+ContextData getLocationContext(TextDocument *document, int lineNumber)
+{
+ ContextData data;
+ QTC_ASSERT(document, return data);
+ data.fileName = document->filePath().toString();
+ if (document->property(Constants::OPENED_WITH_DISASSEMBLY).toBool()) {
+ QString line = document->plainText().section(QLatin1Char('\n'), lineNumber - 1, lineNumber - 1);
+ data.address = DisassemblerLine::addressFromDisassemblyLine(line);
+ } else {
+ data.lineNumber = lineNumber;
+ }
+ return data;
+}
+
} // namespace Internal
} // namespace Debugger