summaryrefslogtreecommitdiffstats
path: root/src/declarative/debugger/qdeclarativedebugtrace.cpp
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2011-01-21 03:48:36 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2011-01-25 00:46:39 (GMT)
commitd7a95474fad9d5ddcc9c9a7473a49644c03e0f7a (patch)
tree01b2548950dc26cbc31c1e9879b2d09720435796 /src/declarative/debugger/qdeclarativedebugtrace.cpp
parent1873b12eb8f5175aa852341a7055add77b6fcc80 (diff)
downloadQt-d7a95474fad9d5ddcc9c9a7473a49644c03e0f7a.zip
Qt-d7a95474fad9d5ddcc9c9a7473a49644c03e0f7a.tar.gz
Qt-d7a95474fad9d5ddcc9c9a7473a49644c03e0f7a.tar.bz2
Add location information for tracing.
Diffstat (limited to 'src/declarative/debugger/qdeclarativedebugtrace.cpp')
-rw-r--r--src/declarative/debugger/qdeclarativedebugtrace.cpp42
1 files changed, 37 insertions, 5 deletions
diff --git a/src/declarative/debugger/qdeclarativedebugtrace.cpp b/src/declarative/debugger/qdeclarativedebugtrace.cpp
index 9fa1f5b..4bad405 100644
--- a/src/declarative/debugger/qdeclarativedebugtrace.cpp
+++ b/src/declarative/debugger/qdeclarativedebugtrace.cpp
@@ -58,6 +58,8 @@ QByteArray QDeclarativeDebugData::toByteArray() const
ds << time << messageType << detailType;
if (messageType == (int)QDeclarativeDebugTrace::RangeData)
ds << detailData;
+ if (messageType == (int)QDeclarativeDebugTrace::RangeLocation)
+ ds << detailData << line;
return data;
}
@@ -92,6 +94,18 @@ void QDeclarativeDebugTrace::rangeData(RangeType t, const QUrl &data)
traceInstance()->rangeDataImpl(t, data);
}
+void QDeclarativeDebugTrace::rangeLocation(RangeType t, const QString &fileName, int line)
+{
+ if (QDeclarativeDebugService::isDebuggingEnabled())
+ traceInstance()->rangeLocationImpl(t, fileName, line);
+}
+
+void QDeclarativeDebugTrace::rangeLocation(RangeType t, const QUrl &fileName, int line)
+{
+ if (QDeclarativeDebugService::isDebuggingEnabled())
+ traceInstance()->rangeLocationImpl(t, fileName, line);
+}
+
void QDeclarativeDebugTrace::endRange(RangeType t)
{
if (QDeclarativeDebugService::isDebuggingEnabled())
@@ -103,7 +117,7 @@ void QDeclarativeDebugTrace::addEventImpl(EventType event)
if (status() != Enabled || !m_enabled)
return;
- QDeclarativeDebugData ed = {m_timer.elapsed(), (int)Event, (int)event, QString()};
+ QDeclarativeDebugData ed = {m_timer.elapsed(), (int)Event, (int)event, QString(), -1};
processMessage(ed);
}
@@ -112,7 +126,7 @@ void QDeclarativeDebugTrace::startRangeImpl(RangeType range)
if (status() != Enabled || !m_enabled)
return;
- QDeclarativeDebugData rd = {m_timer.elapsed(), (int)RangeStart, (int)range, QString()};
+ QDeclarativeDebugData rd = {m_timer.elapsed(), (int)RangeStart, (int)range, QString(), -1};
processMessage(rd);
}
@@ -121,7 +135,7 @@ void QDeclarativeDebugTrace::rangeDataImpl(RangeType range, const QString &rData
if (status() != Enabled || !m_enabled)
return;
- QDeclarativeDebugData rd = {m_timer.elapsed(), (int)RangeData, (int)range, rData};
+ QDeclarativeDebugData rd = {m_timer.elapsed(), (int)RangeData, (int)range, rData, -1};
processMessage(rd);
}
@@ -130,7 +144,25 @@ void QDeclarativeDebugTrace::rangeDataImpl(RangeType range, const QUrl &rData)
if (status() != Enabled || !m_enabled)
return;
- QDeclarativeDebugData rd = {m_timer.elapsed(), (int)RangeData, (int)range, rData.toEncoded(QUrl::FormattingOption(0x100))};
+ QDeclarativeDebugData rd = {m_timer.elapsed(), (int)RangeData, (int)range, rData.toEncoded(QUrl::FormattingOption(0x100)), -1};
+ processMessage(rd);
+}
+
+void QDeclarativeDebugTrace::rangeLocationImpl(RangeType range, const QString &fileName, int line)
+{
+ if (status() != Enabled || !m_enabled)
+ return;
+
+ QDeclarativeDebugData rd = {m_timer.elapsed(), (int)RangeLocation, (int)range, fileName, line};
+ processMessage(rd);
+}
+
+void QDeclarativeDebugTrace::rangeLocationImpl(RangeType range, const QUrl &fileName, int line)
+{
+ if (status() != Enabled || !m_enabled)
+ return;
+
+ QDeclarativeDebugData rd = {m_timer.elapsed(), (int)RangeLocation, (int)range, fileName.toEncoded(QUrl::FormattingOption(0x100)), line};
processMessage(rd);
}
@@ -139,7 +171,7 @@ void QDeclarativeDebugTrace::endRangeImpl(RangeType range)
if (status() != Enabled || !m_enabled)
return;
- QDeclarativeDebugData rd = {m_timer.elapsed(), (int)RangeEnd, (int)range, QString()};
+ QDeclarativeDebugData rd = {m_timer.elapsed(), (int)RangeEnd, (int)range, QString(), -1};
processMessage(rd);
}