diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2013-08-16 08:57:58 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@digia.com> | 2013-08-16 10:14:22 +0200 |
commit | d017fe9b38c74d2cc2fa754af3bf9e32357f149c (patch) | |
tree | d56a6421c026d4ec03165722b66540c7752a9d1e /src/qml/jsruntime/qv4debugging.cpp | |
parent | b88626a3a59f7dcd01be6fe2a8236b14ca1176f5 (diff) |
Store line number mappings in the compiled function
Change-Id: I4e37aac3618b20ccd52ce4833098781374a3daf6
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4debugging.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4debugging.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/qml/jsruntime/qv4debugging.cpp b/src/qml/jsruntime/qv4debugging.cpp index 5965af8cfd..3bb031116e 100644 --- a/src/qml/jsruntime/qv4debugging.cpp +++ b/src/qml/jsruntime/qv4debugging.cpp @@ -350,10 +350,12 @@ void Debugger::BreakPoints::applyToFunction(Function *function, bool removeBreak QList<int>::Iterator breakPoint = breakPointsForFile->begin(); while (breakPoint != breakPointsForFile->end()) { bool breakPointFound = false; - for (QVector<LineNumberMapping>::ConstIterator mapping = function->lineNumberMappings.constBegin(), - end = function->lineNumberMappings.constEnd(); mapping != end; ++mapping) { - if (mapping->lineNumber == *breakPoint) { - uchar *codePtr = const_cast<uchar *>(function->codeData) + mapping->codeOffset; + const quint32 *lineNumberMappings = function->compiledFunction->lineNumberMapping(); + for (int i = 0; i < function->compiledFunction->nLineNumberMappingEntries; ++i) { + const int codeOffset = lineNumberMappings[i * 2]; + const int lineNumber = lineNumberMappings[i * 2 + 1]; + if (lineNumber == *breakPoint) { + uchar *codePtr = const_cast<uchar *>(function->codeData) + codeOffset; QQmlJS::Moth::Instr *instruction = reinterpret_cast<QQmlJS::Moth::Instr*>(codePtr); instruction->common.breakPoint = !removeBreakPoints; // Continue setting the next break point. |