forked from qt-creator/qt-creator
Debugger: Partially merge Breakpoint{Model,Response}Id implementation
... and remove functions that have not been in use since switching the BreakHandler to a TreeModel. Change-Id: I1b4170b4a837284aece7c0ea1a4d76c1127d6503 Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
This commit is contained in:
@@ -38,14 +38,43 @@
|
||||
namespace Debugger {
|
||||
namespace Internal {
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// BreakpointModelId
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////
|
||||
/*!
|
||||
\class Debugger::Internal::BreakpointIdBase
|
||||
|
||||
Convenience base class for BreakpointModelId and
|
||||
BreakpointResponseId.
|
||||
*/
|
||||
|
||||
QDebug operator<<(QDebug d, const BreakpointIdBase &id)
|
||||
{
|
||||
d << qPrintable(id.toString());
|
||||
return d;
|
||||
}
|
||||
|
||||
QByteArray BreakpointIdBase::toByteArray() const
|
||||
{
|
||||
if (!isValid())
|
||||
return "<invalid bkpt>";
|
||||
QByteArray ba = QByteArray::number(m_majorPart);
|
||||
if (isMinor()) {
|
||||
ba.append('.');
|
||||
ba.append(QByteArray::number(m_minorPart));
|
||||
}
|
||||
return ba;
|
||||
}
|
||||
|
||||
QString BreakpointIdBase::toString() const
|
||||
{
|
||||
if (!isValid())
|
||||
return QLatin1String("<invalid bkpt>");
|
||||
if (isMinor())
|
||||
return QString::fromLatin1("%1.%2").arg(m_majorPart).arg(m_minorPart);
|
||||
return QString::number(m_majorPart);
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
\class Debugger::Internal::ModelId
|
||||
\class Debugger::Internal::BreakpointModelId
|
||||
|
||||
This identifies a breakpoint in the \c BreakHandler. The
|
||||
major parts are strictly increasing over time.
|
||||
@@ -55,12 +84,6 @@ namespace Internal {
|
||||
*/
|
||||
|
||||
|
||||
QDebug operator<<(QDebug d, const BreakpointModelId &id)
|
||||
{
|
||||
d << qPrintable(id.toString());
|
||||
return d;
|
||||
}
|
||||
|
||||
BreakpointModelId::BreakpointModelId(const QByteArray &ba)
|
||||
{
|
||||
int pos = ba.indexOf('\'');
|
||||
@@ -73,34 +96,6 @@ BreakpointModelId::BreakpointModelId(const QByteArray &ba)
|
||||
}
|
||||
}
|
||||
|
||||
QByteArray BreakpointModelId::toByteArray() const
|
||||
{
|
||||
if (!isValid())
|
||||
return "<invalid bkpt>";
|
||||
QByteArray ba = QByteArray::number(m_majorPart);
|
||||
if (isMinor()) {
|
||||
ba.append('.');
|
||||
ba.append(QByteArray::number(m_minorPart));
|
||||
}
|
||||
return ba;
|
||||
}
|
||||
|
||||
QString BreakpointModelId::toString() const
|
||||
{
|
||||
if (!isValid())
|
||||
return QLatin1String("<invalid bkpt>");
|
||||
if (isMinor())
|
||||
return QString::fromLatin1("%1.%2").arg(m_majorPart).arg(m_minorPart);
|
||||
return QString::number(m_majorPart);
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// BreakpointResponseId
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////
|
||||
|
||||
/*!
|
||||
\class Debugger::Internal::BreakpointResponseId
|
||||
|
||||
@@ -124,45 +119,6 @@ BreakpointResponseId::BreakpointResponseId(const QByteArray &ba)
|
||||
}
|
||||
}
|
||||
|
||||
QDebug operator<<(QDebug d, const BreakpointResponseId &id)
|
||||
{
|
||||
d << qPrintable(id.toString());
|
||||
return d;
|
||||
}
|
||||
|
||||
QByteArray BreakpointResponseId::toByteArray() const
|
||||
{
|
||||
if (!isValid())
|
||||
return "<invalid bkpt>";
|
||||
QByteArray ba = QByteArray::number(m_majorPart);
|
||||
if (isMinor()) {
|
||||
ba.append('.');
|
||||
ba.append(QByteArray::number(m_minorPart));
|
||||
}
|
||||
return ba;
|
||||
}
|
||||
|
||||
QString BreakpointResponseId::toString() const
|
||||
{
|
||||
if (!isValid())
|
||||
return QLatin1String("<invalid bkpt>");
|
||||
if (isMinor())
|
||||
return QString::fromLatin1("%1.%2").arg(m_majorPart).arg(m_minorPart);
|
||||
return QString::number(m_majorPart);
|
||||
}
|
||||
|
||||
BreakpointResponseId BreakpointResponseId::parent() const
|
||||
{
|
||||
QTC_ASSERT(isMinor(), return BreakpointResponseId());
|
||||
return BreakpointResponseId(m_majorPart, 0);
|
||||
}
|
||||
|
||||
BreakpointResponseId BreakpointResponseId::child(int row) const
|
||||
{
|
||||
QTC_ASSERT(isMajor(), return BreakpointResponseId());
|
||||
return BreakpointResponseId(m_majorPart, row + 1);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// BreakpointParameters
|
||||
|
||||
Reference in New Issue
Block a user