forked from qt-creator/qt-creator
debugger: breakpoint code cosmetics
This commit is contained in:
@@ -439,10 +439,10 @@ QVariant BreakHandler::data(const QModelIndex &mi, int role) const
|
|||||||
data.isWatchpoint() ? data.address : response.address;
|
data.isWatchpoint() ? data.address : response.address;
|
||||||
if (address)
|
if (address)
|
||||||
displayValue += QString::fromAscii("0x%1").arg(address, 0, 16);
|
displayValue += QString::fromAscii("0x%1").arg(address, 0, 16);
|
||||||
if (!response.state.isEmpty()) {
|
if (!response.extra.isEmpty()) {
|
||||||
if (!displayValue.isEmpty())
|
if (!displayValue.isEmpty())
|
||||||
displayValue += QLatin1Char(' ');
|
displayValue += QLatin1Char(' ');
|
||||||
displayValue += QString::fromAscii(response.state);
|
displayValue += QString::fromAscii(response.extra);
|
||||||
}
|
}
|
||||||
return displayValue;
|
return displayValue;
|
||||||
}
|
}
|
||||||
@@ -960,8 +960,8 @@ QString BreakHandler::BreakpointItem::toToolTip() const
|
|||||||
<< "</td><td>" << response.number << "</td></tr>"
|
<< "</td><td>" << response.number << "</td></tr>"
|
||||||
<< "<tr><td>" << tr("Breakpoint Type:")
|
<< "<tr><td>" << tr("Breakpoint Type:")
|
||||||
<< "</td><td>" << t << "</td></tr>"
|
<< "</td><td>" << t << "</td></tr>"
|
||||||
<< "<tr><td>" << tr("State:")
|
<< "<tr><td>" << tr("Extra Information:")
|
||||||
<< "</td><td>" << response.state << "</td></tr>"
|
<< "</td><td>" << response.extra << "</td></tr>"
|
||||||
<< "</table><br><hr><table>"
|
<< "</table><br><hr><table>"
|
||||||
<< "<tr><th>" << tr("Property")
|
<< "<tr><th>" << tr("Property")
|
||||||
<< "</th><th>" << tr("Requested")
|
<< "</th><th>" << tr("Requested")
|
||||||
|
@@ -44,23 +44,22 @@ namespace Internal {
|
|||||||
BreakpointParameters::BreakpointParameters(BreakpointType t)
|
BreakpointParameters::BreakpointParameters(BreakpointType t)
|
||||||
: type(t), enabled(true), useFullPath(false),
|
: type(t), enabled(true), useFullPath(false),
|
||||||
ignoreCount(0), lineNumber(0), address(0)
|
ignoreCount(0), lineNumber(0), address(0)
|
||||||
{
|
{}
|
||||||
}
|
|
||||||
|
|
||||||
bool BreakpointParameters::equals(const BreakpointParameters &rhs) const
|
bool BreakpointParameters::equals(const BreakpointParameters &rhs) const
|
||||||
{
|
{
|
||||||
return type == rhs.type && enabled == rhs.enabled
|
return type == rhs.type
|
||||||
&& useFullPath == rhs.useFullPath
|
&& enabled == rhs.enabled
|
||||||
&& fileName == rhs.fileName && condition == rhs.condition
|
&& useFullPath == rhs.useFullPath
|
||||||
&& ignoreCount == rhs.ignoreCount && lineNumber == rhs.lineNumber
|
&& fileName == rhs.fileName
|
||||||
&& address == rhs.address && threadSpec == rhs.threadSpec
|
&& condition == rhs.condition
|
||||||
&& functionName == rhs.functionName;
|
&& ignoreCount == rhs.ignoreCount
|
||||||
|
&& lineNumber == rhs.lineNumber
|
||||||
|
&& address == rhs.address
|
||||||
|
&& threadSpec == rhs.threadSpec
|
||||||
|
&& functionName == rhs.functionName;
|
||||||
}
|
}
|
||||||
|
|
||||||
BreakpointResponse::BreakpointResponse()
|
|
||||||
: number(0), multiple(false)
|
|
||||||
{}
|
|
||||||
|
|
||||||
bool BreakpointParameters::conditionsMatch(const QByteArray &other) const
|
bool BreakpointParameters::conditionsMatch(const QByteArray &other) const
|
||||||
{
|
{
|
||||||
// Some versions of gdb "beautify" the passed condition.
|
// Some versions of gdb "beautify" the passed condition.
|
||||||
@@ -85,6 +84,17 @@ QString BreakpointParameters::toString() const
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// BreakpointParameters
|
||||||
|
//
|
||||||
|
//////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
BreakpointResponse::BreakpointResponse()
|
||||||
|
: number(0), multiple(false)
|
||||||
|
{}
|
||||||
|
|
||||||
QString BreakpointResponse::toString() const
|
QString BreakpointResponse::toString() const
|
||||||
{
|
{
|
||||||
QString result;
|
QString result;
|
||||||
@@ -107,7 +117,7 @@ void BreakpointResponse::fromParameters(const BreakpointParameters &p)
|
|||||||
number = 0;
|
number = 0;
|
||||||
fullName.clear();
|
fullName.clear();
|
||||||
multiple = false;
|
multiple = false;
|
||||||
state.clear();
|
extra.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
@@ -112,7 +112,7 @@ public:
|
|||||||
int number; // Breakpoint number assigned by the debugger engine.
|
int number; // Breakpoint number assigned by the debugger engine.
|
||||||
QString fullName; // Full file name acknowledged by the debugger engine.
|
QString fullName; // Full file name acknowledged by the debugger engine.
|
||||||
bool multiple; // Happens in constructors/gdb.
|
bool multiple; // Happens in constructors/gdb.
|
||||||
QByteArray state; // gdb: <PENDING>, <MULTIPLE>
|
QByteArray extra; // gdb: <PENDING>, <MULTIPLE>
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef QList<BreakpointId> BreakpointIds;
|
typedef QList<BreakpointId> BreakpointIds;
|
||||||
|
@@ -2074,7 +2074,7 @@ void GdbEngine::setBreakpointDataFromOutput(BreakpointId id, const GdbMi &bkpt)
|
|||||||
if (child.data().startsWith("0x")) {
|
if (child.data().startsWith("0x")) {
|
||||||
response.address = child.data().mid(2).toULongLong(0, 16);
|
response.address = child.data().mid(2).toULongLong(0, 16);
|
||||||
} else {
|
} else {
|
||||||
response.state = child.data();
|
response.extra = child.data();
|
||||||
if (child.data() == "<MULTIPLE>")
|
if (child.data() == "<MULTIPLE>")
|
||||||
response.multiple = true;
|
response.multiple = true;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user