diff options
author | hjk <qtc-committer@nokia.com> | 2011-06-15 14:02:26 +0200 |
---|---|---|
committer | hjk <qthjk@ovi.com> | 2011-06-20 11:34:22 +0200 |
commit | d647a6002e58ef478c5d58a39915ac53eee34a6d (patch) | |
tree | 1c19f9931c2276709e90b442b11dfa39f8d15add /src/plugins/debugger/breakpoint.cpp | |
parent | cc43a59763c141b31230a2bd16582f34e3d8946f (diff) | |
download | qt-creator-d647a6002e58ef478c5d58a39915ac53eee34a6d.tar.gz |
debugger: display "sub-breakpoints"
<MULTIPLE> happens in constructors, inline functions, and
at other places like 'foreach' lines.
Change-Id: Ifb89b659d279f257ba8295b80a35d605820ec54b
Reviewed-on: http://codereview.qt.nokia.com/498
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: hjk <qthjk@ovi.com>
Diffstat (limited to 'src/plugins/debugger/breakpoint.cpp')
-rw-r--r-- | src/plugins/debugger/breakpoint.cpp | 50 |
1 files changed, 48 insertions, 2 deletions
diff --git a/src/plugins/debugger/breakpoint.cpp b/src/plugins/debugger/breakpoint.cpp index 70d75db4da..6b48be34c4 100644 --- a/src/plugins/debugger/breakpoint.cpp +++ b/src/plugins/debugger/breakpoint.cpp @@ -32,6 +32,8 @@ #include "breakpoint.h" +#include "utils/qtcassert.h" + #include <QtCore/QByteArray> #include <QtCore/QDebug> @@ -40,6 +42,39 @@ namespace Internal { ////////////////////////////////////////////////////////////////// // +// BreakpointId +// +////////////////////////////////////////////////////////////////// + +QDebug operator<<(QDebug d, const BreakpointId &id) +{ + d << qPrintable(id.toString()); + return d; +} + +QString BreakpointId::toString() const +{ + if (!isValid()) + return "<invalid bkpt>"; + if (isMinor()) + return QString("%1.%2").arg(m_majorPart).arg(m_minorPart); + return QString::number(m_majorPart); +} + +BreakpointId BreakpointId::parent() const +{ + QTC_ASSERT(isMinor(), return BreakpointId()); + return BreakpointId(m_majorPart, 0); +} + +BreakpointId BreakpointId::child(int row) const +{ + QTC_ASSERT(isMajor(), return BreakpointId()); + return BreakpointId(m_majorPart, row + 1); +} + +////////////////////////////////////////////////////////////////// +// // BreakpointParameters // ////////////////////////////////////////////////////////////////// @@ -163,24 +198,34 @@ QString BreakpointParameters::toString() const */ BreakpointResponse::BreakpointResponse() - : number(0), pending(true), multiple(false), correctedLineNumber(0) -{} +{ + number = 0; + subNumber = 0; + pending = true; + multiple = false; + correctedLineNumber = 0; +} QString BreakpointResponse::toString() const { QString result = BreakpointParameters::toString(); QTextStream ts(&result); ts << " Number: " << number; + if (subNumber) + ts << "." << subNumber; if (pending) ts << " [pending]"; if (!fullName.isEmpty()) ts << " FullName: " << fullName; + if (!functionName.isEmpty()) + ts << " Function: " << functionName; if (multiple) ts << " Multiple: " << multiple; if (!extra.isEmpty()) ts << " Extra: " << extra; if (correctedLineNumber) ts << " CorrectedLineNumber: " << correctedLineNumber; + ts << ' '; return result + BreakpointParameters::toString(); } @@ -188,6 +233,7 @@ void BreakpointResponse::fromParameters(const BreakpointParameters &p) { BreakpointParameters::operator=(p); number = 0; + subNumber = 0; fullName.clear(); multiple = false; extra.clear(); |