debugger: remove intermediate BreakpointData stucture layer

This commit is contained in:
hjk
2010-11-16 11:48:17 +01:00
parent 3a7f7b6d4a
commit 0a004097e1
13 changed files with 185 additions and 290 deletions

View File

@@ -84,30 +84,30 @@ static inline bool fileNameMatch(const QString &f1, const QString &f2)
#endif #endif
} }
static bool isSimilarTo(const BreakpointData &data, const BreakpointResponse &needle) static bool isSimilarTo(const BreakpointParameters &data, const BreakpointResponse &needle)
{ {
// Clear hit. // Clear hit.
// Clear miss. // Clear miss.
if (needle.type != UnknownType && data.type() != UnknownType if (needle.type != UnknownType && data.type != UnknownType
&& data.type() != needle.type) && data.type != needle.type)
return false; return false;
// Clear hit. // Clear hit.
if (data.address() && data.address() == needle.address) if (data.address && data.address == needle.address)
return true; return true;
// At least at a position we were looking for. // At least at a position we were looking for.
// FIXME: breaks multiple breakpoints at the same location // FIXME: breaks multiple breakpoints at the same location
if (!data.fileName().isEmpty() if (!data.fileName.isEmpty()
&& fileNameMatch(data.fileName(), needle.fileName) && fileNameMatch(data.fileName, needle.fileName)
&& data.lineNumber() == needle.lineNumber) && data.lineNumber == needle.lineNumber)
return true; return true;
// At least at a position we were looking for. // At least at a position we were looking for.
// FIXME: breaks multiple breakpoints at the same location // FIXME: breaks multiple breakpoints at the same location
if (!data.fileName().isEmpty() if (!data.fileName.isEmpty()
&& fileNameMatch(data.fileName(), needle.fileName) && fileNameMatch(data.fileName, needle.fileName)
&& data.lineNumber() == needle.lineNumber) && data.lineNumber == needle.lineNumber)
return true; return true;
return false; return false;
@@ -119,7 +119,7 @@ BreakpointId BreakHandler::findSimilarBreakpoint(const BreakpointResponse &needl
ConstIterator it = m_storage.constBegin(), et = m_storage.constEnd(); ConstIterator it = m_storage.constBegin(), et = m_storage.constEnd();
for ( ; it != et; ++it) { for ( ; it != et; ++it) {
const BreakpointId id = it.key(); const BreakpointId id = it.key();
const BreakpointData &data = it->data; const BreakpointParameters &data = it->data;
const BreakpointResponse &response = it->response; const BreakpointResponse &response = it->response;
qDebug() << "COMPARING " << data.toString() << " WITH " << needle.toString(); qDebug() << "COMPARING " << data.toString() << " WITH " << needle.toString();
if (response.number && response.number == needle.number) if (response.number && response.number == needle.number)
@@ -144,7 +144,7 @@ BreakpointId BreakHandler::findBreakpointByFunction(const QString &functionName)
{ {
ConstIterator it = m_storage.constBegin(), et = m_storage.constEnd(); ConstIterator it = m_storage.constBegin(), et = m_storage.constEnd();
for ( ; it != et; ++it) for ( ; it != et; ++it)
if (it->data.functionName() == functionName) if (it->data.functionName == functionName)
return it.key(); return it.key();
return BreakpointId(-1); return BreakpointId(-1);
} }
@@ -153,7 +153,7 @@ BreakpointId BreakHandler::findBreakpointByAddress(quint64 address) const
{ {
ConstIterator it = m_storage.constBegin(), et = m_storage.constEnd(); ConstIterator it = m_storage.constBegin(), et = m_storage.constEnd();
for ( ; it != et; ++it) for ( ; it != et; ++it)
if (it->data.address() == address) if (it->data.address == address)
return it.key(); return it.key();
return BreakpointId(-1); return BreakpointId(-1);
} }
@@ -173,14 +173,14 @@ const BreakpointParameters &BreakHandler::breakpointData(BreakpointId id) const
static BreakpointParameters dummy; static BreakpointParameters dummy;
ConstIterator it = m_storage.find(id); ConstIterator it = m_storage.find(id);
QTC_ASSERT(it != m_storage.end(), return dummy); QTC_ASSERT(it != m_storage.end(), return dummy);
return it->data.parameters(); return it->data;
} }
BreakpointId BreakHandler::findWatchpointByAddress(quint64 address) const BreakpointId BreakHandler::findWatchpointByAddress(quint64 address) const
{ {
ConstIterator it = m_storage.constBegin(), et = m_storage.constEnd(); ConstIterator it = m_storage.constBegin(), et = m_storage.constEnd();
for ( ; it != et; ++it) for ( ; it != et; ++it)
if (it->data.isWatchpoint() && it->data.address() == address) if (it->data.isWatchpoint() && it->data.address == address)
return it.key(); return it.key();
return BreakpointId(-1); return BreakpointId(-1);
} }
@@ -211,30 +211,30 @@ void BreakHandler::saveBreakpoints()
QList<QVariant> list; QList<QVariant> list;
ConstIterator it = m_storage.constBegin(), et = m_storage.constEnd(); ConstIterator it = m_storage.constBegin(), et = m_storage.constEnd();
for ( ; it != et; ++it) { for ( ; it != et; ++it) {
const BreakpointData &data = it->data; const BreakpointParameters &data = it->data;
QMap<QString, QVariant> map; QMap<QString, QVariant> map;
// Do not persist Watchpoints. // Do not persist Watchpoints.
if (data.isWatchpoint()) if (data.isWatchpoint())
continue; continue;
if (data.type() != BreakpointByFileAndLine) if (data.type != BreakpointByFileAndLine)
map.insert(_("type"), data.type()); map.insert(_("type"), data.type);
if (!data.fileName().isEmpty()) if (!data.fileName.isEmpty())
map.insert(_("filename"), data.fileName()); map.insert(_("filename"), data.fileName);
if (data.lineNumber()) if (data.lineNumber)
map.insert(_("linenumber"), data.lineNumber()); map.insert(_("linenumber"), data.lineNumber);
if (!data.functionName().isEmpty()) if (!data.functionName.isEmpty())
map.insert(_("funcname"), data.functionName()); map.insert(_("funcname"), data.functionName);
if (data.address()) if (data.address)
map.insert(_("address"), data.address()); map.insert(_("address"), data.address);
if (!data.condition().isEmpty()) if (!data.condition.isEmpty())
map.insert(_("condition"), data.condition()); map.insert(_("condition"), data.condition);
if (data.ignoreCount()) if (data.ignoreCount)
map.insert(_("ignorecount"), data.ignoreCount()); map.insert(_("ignorecount"), data.ignoreCount);
if (!data.threadSpec().isEmpty()) if (!data.threadSpec.isEmpty())
map.insert(_("threadspec"), data.threadSpec()); map.insert(_("threadspec"), data.threadSpec);
if (!data.isEnabled()) if (!data.enabled)
map.insert(_("disabled"), _("1")); map.insert(_("disabled"), _("1"));
if (data.useFullPath()) if (data.useFullPath)
map.insert(_("usefullpath"), _("1")); map.insert(_("usefullpath"), _("1"));
list.append(map); list.append(map);
} }
@@ -351,7 +351,7 @@ QVariant BreakHandler::data(const QModelIndex &mi, int role) const
BreakpointId id = findBreakpointByIndex(mi); BreakpointId id = findBreakpointByIndex(mi);
ConstIterator it = m_storage.find(id); ConstIterator it = m_storage.find(id);
QTC_ASSERT(it != m_storage.end(), return QVariant()); QTC_ASSERT(it != m_storage.end(), return QVariant());
const BreakpointData &data = it->data; const BreakpointParameters &data = it->data;
const BreakpointResponse &response = it->response; const BreakpointResponse &response = it->response;
switch (mi.column()) { switch (mi.column()) {
@@ -363,7 +363,7 @@ QVariant BreakHandler::data(const QModelIndex &mi, int role) const
if (role == Qt::DecorationRole) { if (role == Qt::DecorationRole) {
if (data.isWatchpoint()) if (data.isWatchpoint())
return m_watchpointIcon; return m_watchpointIcon;
if (!data.isEnabled()) if (!data.enabled)
return m_disabledBreakpointIcon; return m_disabledBreakpointIcon;
return it->isPending() ? m_pendingBreakPointIcon : m_breakpointIcon; return it->isPending() ? m_pendingBreakPointIcon : m_breakpointIcon;
} }
@@ -371,20 +371,20 @@ QVariant BreakHandler::data(const QModelIndex &mi, int role) const
case 1: case 1:
if (role == Qt::DisplayRole) { if (role == Qt::DisplayRole) {
const QString str = it->isPending() const QString str = it->isPending()
? data.functionName() : response.functionName; ? data.functionName : response.functionName;
return str.isEmpty() ? empty : str; return str.isEmpty() ? empty : str;
} }
break; break;
case 2: case 2:
if (role == Qt::DisplayRole) { if (role == Qt::DisplayRole) {
QString str = it->isPending() QString str = it->isPending()
? data.fileName() : response.fileName; ? data.fileName : response.fileName;
str = QFileInfo(str).fileName(); str = QFileInfo(str).fileName();
// FIXME: better? // FIXME: better?
//if (data.bpMultiple && str.isEmpty() && !data.markerFileName.isEmpty()) //if (data.bpMultiple && str.isEmpty() && !data.markerFileName.isEmpty())
// str = data.markerFileName; // str = data.markerFileName;
str = str.isEmpty() ? empty : str; str = str.isEmpty() ? empty : str;
if (data.useFullPath()) if (data.useFullPath)
str = QDir::toNativeSeparators(QLatin1String("/.../") + str); str = QDir::toNativeSeparators(QLatin1String("/.../") + str);
return str; return str;
} }
@@ -395,48 +395,48 @@ QVariant BreakHandler::data(const QModelIndex &mi, int role) const
//if (data.bpMultiple && str.isEmpty() && !data.markerFileName.isEmpty()) //if (data.bpMultiple && str.isEmpty() && !data.markerFileName.isEmpty())
// str = data.markerLineNumber; // str = data.markerLineNumber;
const int nr = it->isPending() const int nr = it->isPending()
? data.lineNumber() : response.lineNumber; ? data.lineNumber : response.lineNumber;
return nr ? QString::number(nr) : empty; return nr ? QString::number(nr) : empty;
} }
if (role == Qt::UserRole + 1) if (role == Qt::UserRole + 1)
return data.lineNumber(); return data.lineNumber;
break; break;
case 4: case 4:
if (role == Qt::DisplayRole) if (role == Qt::DisplayRole)
return it->isPending() ? data.condition() : response.condition; return it->isPending() ? data.condition : response.condition;
if (role == Qt::ToolTipRole) if (role == Qt::ToolTipRole)
return tr("Breakpoint will only be hit if this condition is met."); return tr("Breakpoint will only be hit if this condition is met.");
if (role == Qt::UserRole + 1) if (role == Qt::UserRole + 1)
return data.condition(); return data.condition;
break; break;
case 5: case 5:
if (role == Qt::DisplayRole) { if (role == Qt::DisplayRole) {
const int ignoreCount = const int ignoreCount =
it->isPending() ? data.ignoreCount() : response.ignoreCount; it->isPending() ? data.ignoreCount : response.ignoreCount;
return ignoreCount ? QVariant(ignoreCount) : QVariant(QString()); return ignoreCount ? QVariant(ignoreCount) : QVariant(QString());
} }
if (role == Qt::ToolTipRole) if (role == Qt::ToolTipRole)
return tr("Breakpoint will only be hit after being ignored so many times."); return tr("Breakpoint will only be hit after being ignored so many times.");
if (role == Qt::UserRole + 1) if (role == Qt::UserRole + 1)
return data.ignoreCount(); return data.ignoreCount;
break; break;
case 6: case 6:
if (role == Qt::DisplayRole) { if (role == Qt::DisplayRole) {
if (it->isPending()) if (it->isPending())
return !data.threadSpec().isEmpty() ? data.threadSpec() : tr("(all)"); return !data.threadSpec.isEmpty() ? data.threadSpec : tr("(all)");
else else
return !response.threadSpec.isEmpty() ? response.threadSpec : tr("(all)"); return !response.threadSpec.isEmpty() ? response.threadSpec : tr("(all)");
} }
if (role == Qt::ToolTipRole) if (role == Qt::ToolTipRole)
return tr("Breakpoint will only be hit in the specified thread(s)."); return tr("Breakpoint will only be hit in the specified thread(s).");
if (role == Qt::UserRole + 1) if (role == Qt::UserRole + 1)
return data.threadSpec(); return data.threadSpec;
break; break;
case 7: case 7:
if (role == Qt::DisplayRole) { if (role == Qt::DisplayRole) {
QString displayValue; QString displayValue;
const quint64 address = const quint64 address =
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.state.isEmpty()) {
@@ -462,24 +462,25 @@ type BreakHandler::getter(BreakpointId id) const \
QTC_ASSERT(it != m_storage.end(), \ QTC_ASSERT(it != m_storage.end(), \
qDebug() << "ID" << id << "NOT KNOWN"; \ qDebug() << "ID" << id << "NOT KNOWN"; \
return type()); \ return type()); \
return it->data.getter(); \ return it->data.getter; \
} }
#define SETTER(type, setter) \ #define SETTER(type, getter, setter) \
void BreakHandler::setter(BreakpointId id, const type &value) \ void BreakHandler::setter(BreakpointId id, const type &value) \
{ \ { \
Iterator it = m_storage.find(id); \ Iterator it = m_storage.find(id); \
QTC_ASSERT(it != m_storage.end(), \ QTC_ASSERT(it != m_storage.end(), \
qDebug() << "ID" << id << "NOT KNOWN"; return); \ qDebug() << "ID" << id << "NOT KNOWN"; return); \
if (!it->data.setter(value)) \ if (it->data.getter == value) \
return; \ return; \
it->data.getter = value; \
it->state = BreakpointChangeRequested; \ it->state = BreakpointChangeRequested; \
scheduleSynchronization(); \ scheduleSynchronization(); \
} }
#define PROPERTY(type, getter, setter) \ #define PROPERTY(type, getter, setter) \
GETTER(type, getter) \ GETTER(type, getter) \
SETTER(type, setter) SETTER(type, getter, setter)
PROPERTY(bool, useFullPath, setUseFullPath) PROPERTY(bool, useFullPath, setUseFullPath)
@@ -496,7 +497,7 @@ bool BreakHandler::isEnabled(BreakpointId id) const
{ {
ConstIterator it = m_storage.find(id); ConstIterator it = m_storage.find(id);
QTC_ASSERT(it != m_storage.end(), return false); QTC_ASSERT(it != m_storage.end(), return false);
return it->data.isEnabled(); return it->data.enabled;
} }
void BreakHandler::setEnabled(BreakpointId id, bool on) void BreakHandler::setEnabled(BreakpointId id, bool on)
@@ -504,12 +505,13 @@ void BreakHandler::setEnabled(BreakpointId id, bool on)
Iterator it = m_storage.find(id); Iterator it = m_storage.find(id);
QTC_ASSERT(it != m_storage.end(), return); QTC_ASSERT(it != m_storage.end(), return);
//qDebug() << "SET ENABLED: " << id << it->data.isEnabled() << on; //qDebug() << "SET ENABLED: " << id << it->data.isEnabled() << on;
if (it->data.setEnabled(on)) { if (it->data.enabled == on)
return;
it->data.enabled = on;
it->destroyMarker(); it->destroyMarker();
it->state = BreakpointChangeRequested; it->state = BreakpointChangeRequested;
updateMarker(id); updateMarker(id);
scheduleSynchronization(); scheduleSynchronization();
}
} }
void BreakHandler::setMarkerFileAndLine(BreakpointId id, void BreakHandler::setMarkerFileAndLine(BreakpointId id,
@@ -565,7 +567,7 @@ void BreakHandler::ackCondition(BreakpointId id)
{ {
Iterator it = m_storage.find(id); Iterator it = m_storage.find(id);
QTC_ASSERT(it != m_storage.end(), return); QTC_ASSERT(it != m_storage.end(), return);
it->response.condition = it->data.condition(); it->response.condition = it->data.condition;
updateMarker(id); updateMarker(id);
} }
@@ -573,7 +575,7 @@ void BreakHandler::ackIgnoreCount(BreakpointId id)
{ {
Iterator it = m_storage.find(id); Iterator it = m_storage.find(id);
QTC_ASSERT(it != m_storage.end(), return); QTC_ASSERT(it != m_storage.end(), return);
it->response.ignoreCount = it->data.ignoreCount(); it->response.ignoreCount = it->data.ignoreCount;
updateMarker(id); updateMarker(id);
} }
@@ -581,7 +583,7 @@ void BreakHandler::ackEnabled(BreakpointId id)
{ {
Iterator it = m_storage.find(id); Iterator it = m_storage.find(id);
QTC_ASSERT(it != m_storage.end(), return); QTC_ASSERT(it != m_storage.end(), return);
it->response.enabled = it->data.isEnabled(); it->response.enabled = it->data.enabled;
updateMarker(id); updateMarker(id);
} }
@@ -620,7 +622,7 @@ void BreakHandler::appendBreakpoint(const BreakpointParameters &data)
BreakpointId id(++currentId); BreakpointId id(++currentId);
BreakpointItem item; BreakpointItem item;
item.data.m_parameters = data; item.data = data;
item.markerFileName = data.fileName; item.markerFileName = data.fileName;
item.markerLineNumber = data.lineNumber; item.markerLineNumber = data.lineNumber;
m_storage.insert(id, item); m_storage.insert(id, item);
@@ -674,10 +676,10 @@ void BreakHandler::breakByFunction(const QString &functionName)
// combinations of multiple conditions and ignore counts, though. // combinations of multiple conditions and ignore counts, though.
ConstIterator it = m_storage.constBegin(), et = m_storage.constEnd(); ConstIterator it = m_storage.constBegin(), et = m_storage.constEnd();
for ( ; it != et; ++it) { for ( ; it != et; ++it) {
const BreakpointData &data = it->data; const BreakpointParameters &data = it->data;
if (data.functionName() == functionName if (data.functionName == functionName
&& data.condition().isEmpty() && data.condition.isEmpty()
&& data.ignoreCount() == 0) && data.ignoreCount == 0)
return; return;
} }
BreakpointParameters data(BreakpointByFunction); BreakpointParameters data(BreakpointByFunction);
@@ -689,7 +691,7 @@ QIcon BreakHandler::icon(BreakpointId id) const
{ {
ConstIterator it = m_storage.find(id); ConstIterator it = m_storage.find(id);
QTC_ASSERT(it != m_storage.end(), return pendingBreakPointIcon()); QTC_ASSERT(it != m_storage.end(), return pendingBreakPointIcon());
if (!it->data.isEnabled()) if (!it->data.enabled)
return m_disabledBreakpointIcon; return m_disabledBreakpointIcon;
if (it->state == BreakpointInserted) if (it->state == BreakpointInserted)
return breakpointIcon(); return breakpointIcon();
@@ -719,7 +721,7 @@ void BreakHandler::gotoLocation(BreakpointId id) const
ConstIterator it = m_storage.find(id); ConstIterator it = m_storage.find(id);
QTC_ASSERT(it != m_storage.end(), return); QTC_ASSERT(it != m_storage.end(), return);
debuggerCore()->gotoLocation( debuggerCore()->gotoLocation(
it->data.fileName(), it->data.lineNumber(), false); it->data.fileName, it->data.lineNumber, false);
} }
void BreakHandler::updateLineNumberFromMarker(BreakpointId id, int lineNumber) void BreakHandler::updateLineNumberFromMarker(BreakpointId id, int lineNumber)
@@ -744,7 +746,7 @@ void BreakHandler::updateLineNumberFromMarker(BreakpointId id, int lineNumber)
// the next line that generated code. // the next line that generated code.
// FIXME: Do we need yet another data member? // FIXME: Do we need yet another data member?
if (it->response.number == 0) { if (it->response.number == 0) {
it->data.setLineNumber(lineNumber); it->data.lineNumber = lineNumber;
updateMarker(id); updateMarker(id);
} }
} }
@@ -853,9 +855,9 @@ void BreakHandler::setBreakpointData(BreakpointId id, const BreakpointParameters
{ {
Iterator it = m_storage.find(id); Iterator it = m_storage.find(id);
QTC_ASSERT(it != m_storage.end(), return); QTC_ASSERT(it != m_storage.end(), return);
if (data == it->data.m_parameters) if (data == it->data)
return; return;
it->data.m_parameters = data; it->data = data;
updateMarker(id); updateMarker(id);
layoutChanged(); layoutChanged();
} }
@@ -907,7 +909,7 @@ static QString stateToString(BreakpointState state)
bool BreakHandler::BreakpointItem::isLocatedAt bool BreakHandler::BreakpointItem::isLocatedAt
(const QString &fileName, int lineNumber, bool useMarkerPosition) const (const QString &fileName, int lineNumber, bool useMarkerPosition) const
{ {
int line = useMarkerPosition ? markerLineNumber : data.lineNumber(); int line = useMarkerPosition ? markerLineNumber : data.lineNumber;
return lineNumber == line && fileNameMatch(fileName, markerFileName); return lineNumber == line && fileNameMatch(fileName, markerFileName);
} }
@@ -915,7 +917,7 @@ QString BreakHandler::BreakpointItem::toToolTip() const
{ {
QString t; QString t;
switch (data.type()) { switch (data.type) {
case BreakpointByFileAndLine: case BreakpointByFileAndLine:
t = tr("Breakpoint by File and Line"); t = tr("Breakpoint by File and Line");
break; break;
@@ -967,22 +969,22 @@ QString BreakHandler::BreakpointItem::toToolTip() const
<< "<tr><td>" << tr("Internal Number:") << "<tr><td>" << tr("Internal Number:")
<< "</td><td>&mdash;</td><td>" << response.number << "</td></tr>" << "</td><td>&mdash;</td><td>" << response.number << "</td></tr>"
<< "<tr><td>" << tr("File Name:") << "<tr><td>" << tr("File Name:")
<< "</td><td>" << QDir::toNativeSeparators(data.fileName()) << "</td><td>" << QDir::toNativeSeparators(data.fileName)
<< "</td><td>" << QDir::toNativeSeparators(response.fileName) << "</td><td>" << QDir::toNativeSeparators(response.fileName)
<< "</td></tr>" << "</td></tr>"
<< "<tr><td>" << tr("Function Name:") << "<tr><td>" << tr("Function Name:")
<< "</td><td>" << data.functionName() << "</td><td>" << data.functionName
<< "</td><td>" << response.functionName << "</td></tr>" << "</td><td>" << response.functionName << "</td></tr>"
<< "<tr><td>" << tr("Line Number:") << "</td><td>"; << "<tr><td>" << tr("Line Number:") << "</td><td>";
if (data.lineNumber()) if (data.lineNumber)
str << data.lineNumber(); str << data.lineNumber;
str << "</td><td>"; str << "</td><td>";
if (response.lineNumber) if (response.lineNumber)
str << response.lineNumber; str << response.lineNumber;
str << "</td></tr>" str << "</td></tr>"
<< "<tr><td>" << tr("Breakpoint Address:") << "<tr><td>" << tr("Breakpoint Address:")
<< "</td><td>"; << "</td><td>";
formatAddress(str, data.address()); formatAddress(str, data.address);
str << "</td><td>"; str << "</td><td>";
formatAddress(str, response.address); formatAddress(str, response.address);
//str << "</td></tr>" //str << "</td></tr>"
@@ -994,17 +996,17 @@ QString BreakHandler::BreakpointItem::toToolTip() const
// str << '-'; // str << '-';
str << "</td></tr>" str << "</td></tr>"
<< "<tr><td>" << tr("Condition:") << "<tr><td>" << tr("Condition:")
<< "</td><td>" << data.condition() << "</td><td>" << data.condition
<< "</td><td>" << response.condition << "</td></tr>" << "</td><td>" << response.condition << "</td></tr>"
<< "<tr><td>" << tr("Ignore Count:") << "</td><td>"; << "<tr><td>" << tr("Ignore Count:") << "</td><td>";
if (data.ignoreCount()) if (data.ignoreCount)
str << data.ignoreCount(); str << data.ignoreCount;
str << "</td><td>"; str << "</td><td>";
if (response.ignoreCount) if (response.ignoreCount)
str << response.ignoreCount; str << response.ignoreCount;
str << "</td></tr>" str << "</td></tr>"
<< "<tr><td>" << tr("Thread Specification:") << "<tr><td>" << tr("Thread Specification:")
<< "</td><td>" << data.threadSpec() << "</td><td>" << data.threadSpec
<< "</td><td>" << response.threadSpec << "</td></tr>" << "</td><td>" << response.threadSpec << "</td></tr>"
<< "</table></body></html>"; << "</table></body></html>";
return rc; return rc;

View File

@@ -180,7 +180,7 @@ private:
bool useMarkerPosition) const; bool useMarkerPosition) const;
QString toToolTip() const; QString toToolTip() const;
BreakpointData data; BreakpointParameters data;
BreakpointState state; // Current state of breakpoint. BreakpointState state; // Current state of breakpoint.
DebuggerEngine *engine; // Engine currently handling the breakpoint. DebuggerEngine *engine; // Engine currently handling the breakpoint.
BreakpointResponse response; BreakpointResponse response;

View File

@@ -37,12 +37,12 @@ namespace Internal {
////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////
// //
// BreakpointData // BreakpointParameters
// //
////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////
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)
{ {
} }
@@ -57,68 +57,10 @@ bool BreakpointParameters::equals(const BreakpointParameters &rhs) const
&& functionName == rhs.functionName; && functionName == rhs.functionName;
} }
BreakpointData::BreakpointData(BreakpointType type)
: m_parameters(type)
{}
BreakpointResponse::BreakpointResponse() BreakpointResponse::BreakpointResponse()
: number(0), multiple(false) : number(0), multiple(false)
{} {}
#define SETIT(var, value) return (var != value) && (var = value, true)
bool BreakpointData::setUseFullPath(bool on)
{
SETIT(m_parameters.useFullPath, on);
}
bool BreakpointData::setFileName(const QString &file)
{
SETIT(m_parameters.fileName, file);
}
bool BreakpointData::setEnabled(bool on)
{
SETIT(m_parameters.enabled, on);
}
bool BreakpointData::setIgnoreCount(int count)
{
SETIT(m_parameters.ignoreCount, count);
}
bool BreakpointData::setFunctionName(const QString &name)
{
SETIT(m_parameters.functionName, name);
}
bool BreakpointData::setLineNumber(int line)
{
SETIT(m_parameters.lineNumber, line);
}
bool BreakpointData::setAddress(quint64 address)
{
SETIT(m_parameters.address, address);
}
bool BreakpointData::setThreadSpec(const QByteArray &spec)
{
SETIT(m_parameters.threadSpec, spec);
}
bool BreakpointData::setType(BreakpointType type)
{
SETIT(m_parameters.type, type);
}
bool BreakpointData::setCondition(const QByteArray &cond)
{
SETIT(m_parameters.condition, cond);
}
#undef SETIT
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.
@@ -129,17 +71,17 @@ bool BreakpointParameters::conditionsMatch(const QByteArray &other) const
return s1 == s2; return s1 == s2;
} }
QString BreakpointData::toString() const QString BreakpointParameters::toString() const
{ {
QString result; QString result;
QTextStream ts(&result); QTextStream ts(&result);
ts << fileName(); ts << fileName;
ts << condition(); ts << condition;
ts << ignoreCount(); ts << ignoreCount;
ts << lineNumber(); ts << lineNumber;
ts << address(); ts << address;
ts << functionName(); ts << functionName;
ts << useFullPath(); ts << useFullPath;
return result; return result;
} }

View File

@@ -40,13 +40,6 @@ typedef quint64 BreakpointId; // FIXME: make Internal.
namespace Internal { namespace Internal {
class BreakWindow;
class BreakpointDialog;
class BreakHandler;
class BreakpointData;
QDataStream &operator>>(QDataStream& stream, BreakpointData &data);
////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////
// //
// BreakpointData // BreakpointData
@@ -85,6 +78,12 @@ public:
explicit BreakpointParameters(BreakpointType = UnknownType); explicit BreakpointParameters(BreakpointType = UnknownType);
bool equals(const BreakpointParameters &rhs) const; bool equals(const BreakpointParameters &rhs) const;
bool conditionsMatch(const QByteArray &other) const; bool conditionsMatch(const QByteArray &other) const;
bool isWatchpoint() const { return type == Watchpoint; }
bool isBreakpoint() const { return type != Watchpoint; } // Enough for now.
QString toString() const;
bool operator==(const BreakpointParameters &p) const { return equals(p); }
bool operator!=(const BreakpointParameters &p) const { return !equals(p); }
BreakpointType type; // Type of breakpoint. BreakpointType type; // Type of breakpoint.
bool enabled; // Should we talk to the debugger engine? bool enabled; // Should we talk to the debugger engine?
@@ -98,58 +97,6 @@ public:
QString functionName; QString functionName;
}; };
inline bool operator==(const BreakpointParameters &p1, const BreakpointParameters &p2)
{ return p1.equals(p2); }
inline bool operator!=(const BreakpointParameters &p1, const BreakpointParameters &p2)
{ return !p1.equals(p2); }
class BreakpointData
{
private:
friend class BreakHandler; // This should be the only class manipulating data.
friend class BreakWindow; // FIXME: Remove.
friend class BreakpointDialog; // FIXME: Remove.
friend QDataStream &operator>>(QDataStream& stream, BreakpointData &data);
public:
explicit BreakpointData(BreakpointType type = UnknownType);
BreakpointType type() const { return m_parameters.type; }
quint64 address() const { return m_parameters.address; }
bool useFullPath() const { return m_parameters.useFullPath; }
QString toString() const;
QString functionName() const { return m_parameters.functionName; }
QString fileName() const { return m_parameters.fileName; }
int lineNumber() const { return m_parameters.lineNumber; }
int ignoreCount() const { return m_parameters.ignoreCount; }
bool isEnabled() const { return m_parameters.enabled; }
QByteArray threadSpec() const { return m_parameters.threadSpec; }
QByteArray condition() const { return m_parameters.condition; }
const BreakpointParameters &parameters() const { return m_parameters; }
bool isWatchpoint() const { return type() == Watchpoint; }
bool isBreakpoint() const { return type() != Watchpoint; } // Enough for now.
private:
// All setters return true on change.
bool setUseFullPath(bool on);
bool setMarkerFileName(const QString &file);
bool setMarkerLineNumber(int line);
bool setFileName(const QString &file);
bool setEnabled(bool on);
bool setIgnoreCount(int count);
bool setFunctionName(const QString &name);
bool setLineNumber(int line);
bool setAddress(quint64 address);
bool setThreadSpec(const QByteArray &spec);
bool setType(BreakpointType type);
bool setCondition(const QByteArray &cond);
private:
// This "user requested information" will get stored in the session.
BreakpointParameters m_parameters;
};
// This is what debuggers produced in response to the attempt to // This is what debuggers produced in response to the attempt to
// insert a breakpoint. The data might differ from the requested bits. // insert a breakpoint. The data might differ from the requested bits.

View File

@@ -1323,12 +1323,12 @@ void DebuggerEngine::notifyBreakpointChangeFailed(BreakpointId id)
breakHandler()->notifyBreakpointChangeFailed(id); breakHandler()->notifyBreakpointChangeFailed(id);
} }
/* void DebuggerEngine::notifyBreakpointAdjusted(BreakpointId id,
void DebuggerEngine::notifyBreakpointAdjusted(BreakpointId id) const BreakpointParameters &data)
{ {
breakHandler()->notifyChangeBreakpointAdjusted(id); QTC_ASSERT(false, /* FIXME */);
breakHandler()->setBreakpointData(id, data);
} }
*/
void DebuggerEngine::selectThread(int) void DebuggerEngine::selectThread(int)
{ {

View File

@@ -129,7 +129,7 @@ class StackFrame;
class SourceFilesHandler; class SourceFilesHandler;
class ThreadsHandler; class ThreadsHandler;
class WatchHandler; class WatchHandler;
class BreakpointData; class BreakpointParameters;
struct WatchUpdateFlags struct WatchUpdateFlags
{ {
@@ -195,6 +195,8 @@ public:
virtual void changeBreakpoint(BreakpointId id); // FIXME: make pure virtual void changeBreakpoint(BreakpointId id); // FIXME: make pure
virtual void notifyBreakpointChangeOk(BreakpointId id); virtual void notifyBreakpointChangeOk(BreakpointId id);
virtual void notifyBreakpointChangeFailed(BreakpointId id); virtual void notifyBreakpointChangeFailed(BreakpointId id);
virtual void notifyBreakpointAdjusted(BreakpointId id,
const Internal::BreakpointParameters &data);
virtual void assignValueInDebugger(const Internal::WatchData *data, virtual void assignValueInDebugger(const Internal::WatchData *data,
const QString &expr, const QVariant &value); const QString &expr, const QVariant &value);

View File

@@ -164,31 +164,31 @@ QDataStream &operator>>(QDataStream &stream, BreakpointResponse &s)
return stream; return stream;
} }
QDataStream &operator<<(QDataStream &stream, const BreakpointData &s) QDataStream &operator<<(QDataStream &stream, const BreakpointParameters &s)
{ {
stream << s.fileName(); stream << s.fileName;
stream << s.condition(); stream << s.condition;
stream << quint64(s.ignoreCount()); stream << quint64(s.ignoreCount);
stream << quint64(s.lineNumber()); stream << quint64(s.lineNumber);
stream << quint64(s.address()); stream << quint64(s.address);
stream << s.functionName(); stream << s.functionName;
stream << s.useFullPath(); stream << s.useFullPath;
return stream; return stream;
} }
QDataStream &operator>>(QDataStream &stream, BreakpointData &s) QDataStream &operator>>(QDataStream &stream, BreakpointParameters &s)
{ {
quint64 t; quint64 t;
QString str; QString str;
QByteArray ba; QByteArray ba;
bool b; bool b;
stream >> str; s.setFileName(str); stream >> str; s.fileName = str;
stream >> ba; s.setCondition(ba); stream >> ba; s.condition = ba;
stream >> t; s.setIgnoreCount(t); stream >> t; s.ignoreCount = t;
stream >> t; s.setLineNumber(t); stream >> t; s.lineNumber = t;
stream >> t; s.setAddress(t); stream >> t; s.address = t;
stream >> str; s.setFunctionName(str); stream >> str; s.functionName = str;
stream >> b; s.setUseFullPath(b); stream >> b; s.useFullPath = b;
return stream; return stream;
} }

View File

@@ -29,11 +29,13 @@
#ifndef DEBUGGERPLUGIN_STREAMOPS_H #ifndef DEBUGGERPLUGIN_STREAMOPS_H
#define DEBUGGERPLUGIN_STREAMOPS_H #define DEBUGGERPLUGIN_STREAMOPS_H
#include <QtCore/QDataStream>
#include "breakpoint.h" #include "breakpoint.h"
#include "stackframe.h" #include "stackframe.h"
#include "watchdata.h"
#include "threaddata.h" #include "threaddata.h"
#include "watchdata.h"
#include <QtCore/QDataStream>
#include <QtCore/QVector> #include <QtCore/QVector>
namespace Debugger { namespace Debugger {
@@ -47,8 +49,8 @@ QDataStream &operator<<(QDataStream& stream, const StackFrame& frame);
QDataStream &operator>>(QDataStream& stream, StackFrame &frame); QDataStream &operator>>(QDataStream& stream, StackFrame &frame);
QDataStream &operator<<(QDataStream& stream, const StackFrames& frames); QDataStream &operator<<(QDataStream& stream, const StackFrames& frames);
QDataStream &operator>>(QDataStream& stream, StackFrames &frames); QDataStream &operator>>(QDataStream& stream, StackFrames &frames);
QDataStream &operator<<(QDataStream& stream, const BreakpointData &data); QDataStream &operator<<(QDataStream& stream, const BreakpointParameters &data);
QDataStream &operator>>(QDataStream& stream, BreakpointData &data); QDataStream &operator>>(QDataStream& stream, BreakpointParameters &data);
QDataStream &operator<<(QDataStream& stream, const BreakpointResponse &data); QDataStream &operator<<(QDataStream& stream, const BreakpointResponse &data);
QDataStream &operator>>(QDataStream& stream, BreakpointResponse &data); QDataStream &operator>>(QDataStream& stream, BreakpointResponse &data);
QDataStream &operator<<(QDataStream& stream, const WatchData &data); QDataStream &operator<<(QDataStream& stream, const WatchData &data);

View File

@@ -60,7 +60,6 @@ class AbstractGdbProcess;
class GdbResponse; class GdbResponse;
class GdbMi; class GdbMi;
class BreakpointData;
class WatchData; class WatchData;
class DisassemblerAgentCookie; class DisassemblerAgentCookie;

View File

@@ -94,8 +94,8 @@ void IPCEngineGuest::rpcCall(IPCEngineGuest::Function f, QByteArray payload )
QDataStream s(m_device); QDataStream s(m_device);
SET_NATIVE_BYTE_ORDER(s); SET_NATIVE_BYTE_ORDER(s);
s << m_cookie++; s << m_cookie++;
s << (quint64) f; s << quint64(f);
s << (quint64) payload.size(); s << quint64(payload.size());
} }
m_device->write(payload); m_device->write(payload);
m_device->putChar('T'); m_device->putChar('T');
@@ -136,7 +136,7 @@ void IPCEngineGuest::readyRead()
QTimer::singleShot(0, this, SLOT(readyRead())); QTimer::singleShot(0, this, SLOT(readyRead()));
} }
void IPCEngineGuest::rpcCallback(quint64 f, QByteArray payload ) void IPCEngineGuest::rpcCallback(quint64 f, QByteArray payload)
{ {
switch (f) { switch (f) {
default: default:
@@ -274,7 +274,7 @@ void IPCEngineGuest::rpcCallback(quint64 f, QByteArray payload )
{ {
QDataStream s(payload); QDataStream s(payload);
SET_NATIVE_BYTE_ORDER(s); SET_NATIVE_BYTE_ORDER(s);
BreakpointData d; BreakpointParameters d;
s >> d; s >> d;
addBreakpoint(d); addBreakpoint(d);
} }
@@ -292,7 +292,7 @@ void IPCEngineGuest::rpcCallback(quint64 f, QByteArray payload )
{ {
QDataStream s(payload); QDataStream s(payload);
SET_NATIVE_BYTE_ORDER(s); SET_NATIVE_BYTE_ORDER(s);
BreakpointData d; BreakpointParameters d;
s >> d; s >> d;
changeBreakpoint(d); changeBreakpoint(d);
} }
@@ -511,7 +511,7 @@ void IPCEngineGuest::disassembled(quint64 pc, const QString &da)
rpcCall(Disassembled, p); rpcCall(Disassembled, p);
} }
void IPCEngineGuest::notifyAddBreakpointOk(quint64 id) void IPCEngineGuest::notifyAddBreakpointOk(BreakpointId id)
{ {
QByteArray p; QByteArray p;
{ {
@@ -522,7 +522,7 @@ void IPCEngineGuest::notifyAddBreakpointOk(quint64 id)
rpcCall(NotifyAddBreakpointOk, p); rpcCall(NotifyAddBreakpointOk, p);
} }
void IPCEngineGuest::notifyAddBreakpointFailed(quint64 id) void IPCEngineGuest::notifyAddBreakpointFailed(BreakpointId id)
{ {
QByteArray p; QByteArray p;
{ {
@@ -533,7 +533,7 @@ void IPCEngineGuest::notifyAddBreakpointFailed(quint64 id)
rpcCall(NotifyAddBreakpointFailed, p); rpcCall(NotifyAddBreakpointFailed, p);
} }
void IPCEngineGuest::notifyRemoveBreakpointOk(quint64 id) void IPCEngineGuest::notifyRemoveBreakpointOk(BreakpointId id)
{ {
QByteArray p; QByteArray p;
{ {
@@ -544,7 +544,7 @@ void IPCEngineGuest::notifyRemoveBreakpointOk(quint64 id)
rpcCall(NotifyRemoveBreakpointOk, p); rpcCall(NotifyRemoveBreakpointOk, p);
} }
void IPCEngineGuest::notifyRemoveBreakpointFailed(quint64 id) void IPCEngineGuest::notifyRemoveBreakpointFailed(BreakpointId id)
{ {
QByteArray p; QByteArray p;
{ {
@@ -555,7 +555,7 @@ void IPCEngineGuest::notifyRemoveBreakpointFailed(quint64 id)
rpcCall(NotifyRemoveBreakpointFailed, p); rpcCall(NotifyRemoveBreakpointFailed, p);
} }
void IPCEngineGuest::notifyChangeBreakpointOk(quint64 id) void IPCEngineGuest::notifyChangeBreakpointOk(BreakpointId id)
{ {
QByteArray p; QByteArray p;
{ {
@@ -566,7 +566,7 @@ void IPCEngineGuest::notifyChangeBreakpointOk(quint64 id)
rpcCall(NotifyChangeBreakpointOk, p); rpcCall(NotifyChangeBreakpointOk, p);
} }
void IPCEngineGuest::notifyChangeBreakpointFailed(quint64 id) void IPCEngineGuest::notifyChangeBreakpointFailed(BreakpointId id)
{ {
QByteArray p; QByteArray p;
{ {
@@ -577,18 +577,19 @@ void IPCEngineGuest::notifyChangeBreakpointFailed(quint64 id)
rpcCall(NotifyChangeBreakpointFailed, p); rpcCall(NotifyChangeBreakpointFailed, p);
} }
void IPCEngineGuest::notifyBreakpointAdjusted(const Internal::BreakpointData &bp) void IPCEngineGuest::notifyBreakpointAdjusted(BreakpointId id,
const BreakpointParameters &bp)
{ {
QByteArray p; QByteArray p;
{ {
QDataStream s(&p, QIODevice::WriteOnly); QDataStream s(&p, QIODevice::WriteOnly);
SET_NATIVE_BYTE_ORDER(s); SET_NATIVE_BYTE_ORDER(s);
s << bp; s << id << bp;
} }
rpcCall(NotifyBreakpointAdjusted, p); rpcCall(NotifyBreakpointAdjusted, p);
} }
void IPCEngineGuest::updateWatchData(bool fullCycle, const QList<Internal::WatchData> &wd) void IPCEngineGuest::updateWatchData(bool fullCycle, const QList<WatchData> &wd)
{ {
QByteArray p; QByteArray p;
{ {

View File

@@ -30,14 +30,14 @@
#ifndef DEBUGGER_IPCENGINE_H #ifndef DEBUGGER_IPCENGINE_H
#define DEBUGGER_IPCENGINE_H #define DEBUGGER_IPCENGINE_H
#include "debuggerengine.h"
#include "threadshandler.h"
#include "stackhandler.h"
#include "breakhandler.h" #include "breakhandler.h"
#include "debuggerengine.h"
#include "stackhandler.h"
#include "threadshandler.h"
#include <QtCore/QQueue> #include <QtCore/QQueue>
#include <QtCore/QVariant>
#include <QtCore/QThread> #include <QtCore/QThread>
#include <QtCore/QVariant>
namespace Debugger { namespace Debugger {
namespace Internal { namespace Internal {
@@ -74,11 +74,11 @@ public:
virtual void activateFrame(qint64 token) = 0; virtual void activateFrame(qint64 token) = 0;
virtual void selectThread(qint64 token) = 0; virtual void selectThread(qint64 token) = 0;
virtual void disassemble(quint64 pc) = 0; virtual void disassemble(quint64 pc) = 0;
virtual void addBreakpoint(const Internal::BreakpointData &bp) = 0; virtual void addBreakpoint(const BreakpointParameters &bp) = 0;
virtual void removeBreakpoint(quint64 id) = 0; virtual void removeBreakpoint(quint64 id) = 0;
virtual void changeBreakpoint(const Internal::BreakpointData &bp) = 0; virtual void changeBreakpoint(const BreakpointParameters &bp) = 0;
virtual void requestUpdateWatchData(const Internal::WatchData &data, virtual void requestUpdateWatchData(const WatchData &data,
const Internal::WatchUpdateFlags & flags = Internal::WatchUpdateFlags()) = 0; const WatchUpdateFlags & flags = WatchUpdateFlags()) = 0;
enum Function enum Function
{ {
@@ -154,15 +154,15 @@ public:
void listThreads(const Threads &); void listThreads(const Threads &);
void disassembled(quint64 pc, const QString &da); void disassembled(quint64 pc, const QString &da);
void notifyAddBreakpointOk(quint64 id); void notifyAddBreakpointOk(BreakpointId id);
void notifyAddBreakpointFailed(quint64 id); void notifyAddBreakpointFailed(BreakpointId id);
void notifyRemoveBreakpointOk(quint64 id); void notifyRemoveBreakpointOk(BreakpointId id);
void notifyRemoveBreakpointFailed(quint64 id); void notifyRemoveBreakpointFailed(BreakpointId id);
void notifyChangeBreakpointOk(quint64 id); void notifyChangeBreakpointOk(BreakpointId id);
void notifyChangeBreakpointFailed(quint64 id); void notifyChangeBreakpointFailed(BreakpointId id);
void notifyBreakpointAdjusted(const Internal::BreakpointData &bp); void notifyBreakpointAdjusted(BreakpointId id, const BreakpointParameters &bp);
void updateWatchData(bool fullCycle, const QList<Internal::WatchData> &); void updateWatchData(bool fullCycle, const QList<WatchData> &);
void rpcCall(Function f, QByteArray payload = QByteArray()); void rpcCall(Function f, QByteArray payload = QByteArray());
public slots: public slots:

View File

@@ -228,7 +228,7 @@ void IPCEngineHost::selectThread(int index)
rpcCall(SelectThread, p); rpcCall(SelectThread, p);
} }
void IPCEngineHost::fetchDisassembler(Internal::DisassemblerViewAgent *v) void IPCEngineHost::fetchDisassembler(DisassemblerViewAgent *v)
{ {
quint64 address = v->frame().address; quint64 address = v->frame().address;
m_frameToDisassemblerAgent.insert(address, v); m_frameToDisassemblerAgent.insert(address, v);
@@ -242,7 +242,7 @@ void IPCEngineHost::fetchDisassembler(Internal::DisassemblerViewAgent *v)
} }
void IPCEngineHost::addBreakpoint(const Internal::BreakpointData &bp) void IPCEngineHost::addBreakpoint(const BreakpointParameters &bp)
{ {
QByteArray p; QByteArray p;
{ {
@@ -264,7 +264,7 @@ void IPCEngineHost::removeBreakpoint(quint64 id)
rpcCall(RemoveBreakpoint, p); rpcCall(RemoveBreakpoint, p);
} }
void IPCEngineHost::changeBreakpoint(const Internal::BreakpointData &bp) void IPCEngineHost::changeBreakpoint(const BreakpointParameters &bp)
{ {
QByteArray p; QByteArray p;
{ {
@@ -275,8 +275,8 @@ void IPCEngineHost::changeBreakpoint(const Internal::BreakpointData &bp)
rpcCall(RemoveBreakpoint, p); rpcCall(RemoveBreakpoint, p);
} }
void IPCEngineHost::updateWatchData(const Internal::WatchData &data, void IPCEngineHost::updateWatchData(const WatchData &data,
const Internal::WatchUpdateFlags &flags) const WatchUpdateFlags &flags)
{ {
Q_UNUSED(flags); Q_UNUSED(flags);
QByteArray p; QByteArray p;
@@ -442,7 +442,7 @@ void IPCEngineHost::rpcCallback(quint64 f, QByteArray payload)
QString da; QString da;
s >> pc; s >> pc;
s >> da; s >> da;
Internal::DisassemblerViewAgent *view = m_frameToDisassemblerAgent.take(pc); DisassemblerViewAgent *view = m_frameToDisassemblerAgent.take(pc);
if (view) if (view)
view->setContents(da); view->setContents(da);
} }
@@ -473,7 +473,7 @@ void IPCEngineHost::rpcCallback(quint64 f, QByteArray payload)
{ {
QDataStream s(payload); QDataStream s(payload);
SET_NATIVE_BYTE_ORDER(s); SET_NATIVE_BYTE_ORDER(s);
quint64 id; BreakpointId id;
s >> id; s >> id;
notifyBreakpointInsertOk(id); notifyBreakpointInsertOk(id);
} }
@@ -481,7 +481,7 @@ void IPCEngineHost::rpcCallback(quint64 f, QByteArray payload)
{ {
QDataStream s(payload); QDataStream s(payload);
SET_NATIVE_BYTE_ORDER(s); SET_NATIVE_BYTE_ORDER(s);
quint64 id; BreakpointId id;
s >> id; s >> id;
notifyBreakpointInsertFailed(id); notifyBreakpointInsertFailed(id);
} }
@@ -489,7 +489,7 @@ void IPCEngineHost::rpcCallback(quint64 f, QByteArray payload)
{ {
QDataStream s(payload); QDataStream s(payload);
SET_NATIVE_BYTE_ORDER(s); SET_NATIVE_BYTE_ORDER(s);
quint64 id; BreakpointId id;
s >> id; s >> id;
notifyBreakpointRemoveOk(id); notifyBreakpointRemoveOk(id);
} }
@@ -497,7 +497,7 @@ void IPCEngineHost::rpcCallback(quint64 f, QByteArray payload)
{ {
QDataStream s(payload); QDataStream s(payload);
SET_NATIVE_BYTE_ORDER(s); SET_NATIVE_BYTE_ORDER(s);
quint64 id; BreakpointId id;
s >> id; s >> id;
notifyBreakpointRemoveFailed(id); notifyBreakpointRemoveFailed(id);
} }
@@ -505,7 +505,7 @@ void IPCEngineHost::rpcCallback(quint64 f, QByteArray payload)
{ {
QDataStream s(payload); QDataStream s(payload);
SET_NATIVE_BYTE_ORDER(s); SET_NATIVE_BYTE_ORDER(s);
quint64 id; BreakpointId id;
s >> id; s >> id;
notifyBreakpointChangeOk(id); notifyBreakpointChangeOk(id);
} }
@@ -513,7 +513,7 @@ void IPCEngineHost::rpcCallback(quint64 f, QByteArray payload)
{ {
QDataStream s(payload); QDataStream s(payload);
SET_NATIVE_BYTE_ORDER(s); SET_NATIVE_BYTE_ORDER(s);
quint64 id; BreakpointId id;
s >> id; s >> id;
notifyBreakpointChangeFailed(id); notifyBreakpointChangeFailed(id);
} }
@@ -521,10 +521,10 @@ void IPCEngineHost::rpcCallback(quint64 f, QByteArray payload)
{ {
QDataStream s(payload); QDataStream s(payload);
SET_NATIVE_BYTE_ORDER(s); SET_NATIVE_BYTE_ORDER(s);
BreakpointData d; BreakpointId id;
s >> d; BreakpointParameters d;
qDebug() << "FIXME"; s >> id >> d;
//notifyBreakpointAdjusted(d); notifyBreakpointAdjusted(id, d);
} }
} }
} }

View File

@@ -103,12 +103,12 @@ public:
void executeJumpToLine(const QString &fileName, int lineNumber); void executeJumpToLine(const QString &fileName, int lineNumber);
void activateFrame(int index); void activateFrame(int index);
void selectThread(int index); void selectThread(int index);
void fetchDisassembler(Internal::DisassemblerViewAgent *); void fetchDisassembler(DisassemblerViewAgent *);
void addBreakpoint(const Internal::BreakpointData &bp); void addBreakpoint(const BreakpointParameters &bp);
void removeBreakpoint(quint64 id); void removeBreakpoint(quint64 id);
void changeBreakpoint(const Internal::BreakpointData &bp); void changeBreakpoint(const BreakpointParameters &bp);
void updateWatchData(const Internal::WatchData &data, void updateWatchData(const WatchData &data,
const Internal::WatchUpdateFlags &flags = Internal::WatchUpdateFlags()); const WatchUpdateFlags &flags = WatchUpdateFlags());
void rpcCall(Function f, QByteArray payload = QByteArray()); void rpcCall(Function f, QByteArray payload = QByteArray());
public slots: public slots:
@@ -123,7 +123,7 @@ private:
quint64 m_nextMessagePayloadSize; quint64 m_nextMessagePayloadSize;
quint64 m_cookie; quint64 m_cookie;
QIODevice *m_device; QIODevice *m_device;
QHash <quint64, Internal::DisassemblerViewAgent *> m_frameToDisassemblerAgent; QHash <quint64, DisassemblerViewAgent *> m_frameToDisassemblerAgent;
}; };
} // namespace Internal } // namespace Internal