for ( ; it != et; ++it) {
const BreakpointParameters &data = it->data;
QMap<QString, QVariant> map;
- // Do not persist Watchpoints.
- if (data.isWatchpoint())
- continue;
if (data.type != BreakpointByFileAndLine)
map.insert(_("type"), data.type);
if (!data.fileName.isEmpty())
map.insert(_("module"), data.module);
if (!data.command.isEmpty())
map.insert(_("command"), data.command);
+ if (!data.expression.isEmpty())
+ map.insert(_("expression"), data.expression);
list.append(map);
}
debuggerCore()->setSessionValue("Breakpoints", list);
v = map.value(_("command"));
if (v.isValid())
data.command = v.toString();
+ v = map.value(_("expression"));
+ if (v.isValid())
+ data.expression = v.toString();
appendBreakpoint(data);
}
//qDebug() << "LOADED BREAKPOINTS" << this << list.size();
|| data.type == BreakpointAtSysCall)
return typeToString(data.type);
if (data.type == WatchpointAtAddress)
- return tr("Data breakpoint at 0x%1").arg(data.address, 0, 16);
+ return tr("Data at 0x%1").arg(data.address, 0, 16);
if (data.type == WatchpointAtExpression)
- return tr("Data breakpoint at %1").arg(data.expression);
+ return tr("Data at %1").arg(data.expression);
return empty;
}
break;
it->response = BreakpointResponse();
delete it->marker;
it->marker = 0;
+ if (it->data.type == WatchpointAtAddress
+ || it->data.type == WatchpointAtExpression
+ || it->data.type == BreakpointByAddress)
+ it->data.enabled = false;
updateMarker(id);
layoutChanged();
}
}
void BreakHandler::setResponse(BreakpointId id,
- const BreakpointResponse &response, bool takeOver)
+ const BreakpointResponse &response)
{
Iterator it = m_storage.find(id);
BREAK_ASSERT(it != m_storage.end(), return);
item.response = response;
item.destroyMarker();
// Take over corrected values from response.
- if (takeOver) {
- if ((item.data.type == BreakpointByFileAndLine
- || item.data.type == BreakpointByFunction)
- && !response.module.isEmpty())
- item.data.module = response.module;
- }
+ if ((item.data.type == BreakpointByFileAndLine
+ || item.data.type == BreakpointByFunction)
+ && !response.module.isEmpty())
+ item.data.module = response.module;
updateMarker(id);
}
DebuggerEngine *engine(BreakpointId id) const;
void setEngine(BreakpointId id, DebuggerEngine *engine);
const BreakpointResponse &response(BreakpointId id) const;
- void setResponse(BreakpointId id, const BreakpointResponse &data, bool takeOver = true);
+ void setResponse(BreakpointId id, const BreakpointResponse &data);
bool needsChange(BreakpointId id) const;
// State transitions.
// Mac yields:
//>32^done,wpt={number="4",exp="*4355182176"}
bresponse.number = wpt.findChild("number").data().toInt();
- bresponse.address = wpt.findChild("exp").toAddress();
+ QByteArray exp = wpt.findChild("exp").data();
+ if (exp.startsWith('*'))
+ bresponse.address = exp.mid(1).toULongLong(0, 0);
handler->setResponse(id, bresponse);
QTC_ASSERT(!handler->needsChange(id), /**/);
handler->notifyBreakpointInsertOk(id);
// Non-Mac: "Hardware watchpoint 2: *0xbfffed40\n"
const int end = ba.indexOf(':');
const int begin = ba.lastIndexOf(' ', end) + 1;
- const QByteArray address = ba.mid(end + 3).trimmed();
+ const QByteArray address = ba.mid(end + 2).trimmed();
bresponse.number = ba.mid(begin, end - begin).toInt();
- bresponse.address = address.toULongLong(0, 0);
+ if (address.startsWith('*'))
+ bresponse.address = address.mid(1).toULongLong(0, 0);
handler->setResponse(id, bresponse);
QTC_ASSERT(!handler->needsChange(id), /**/);
handler->notifyBreakpointInsertOk(id);
ba.chop(1);
if (ba.startsWith('*') || ba.startsWith('@'))
ba = ba.mid(1);
- return ba.toULongLong(0, 16);
+ return ba.toULongLong(0, 0);
}
//////////////////////////////////////////////////////////////////////////////////
QString WatchData::msgNotInScope()
{
- //: Value of variable in Debugger Locals display for variables out of scope (stopped above initialization).
- static const QString rc = QCoreApplication::translate("Debugger::Internal::WatchData", "<not in scope>");
+ //: Value of variable in Debugger Locals display for variables out
+ //: of scope (stopped above initialization).
+ static const QString rc =
+ QCoreApplication::translate("Debugger::Internal::WatchData", "<not in scope>");
return rc;
}
//: Display of variables shadowed by variables of the same name
//: in nested scopes: Variable %1 is the variable name, %2 is a
//: simple count.
- static const QString format = QCoreApplication::translate("Debugger::Internal::WatchData", "%1 <shadowed %2>");
+ static const QString format =
+ QCoreApplication::translate("Debugger::Internal::WatchData", "%1 <shadowed %2>");
return format;
}
QByteArray WatchData::hexAddress() const
{
- return address ? (QByteArray("0x") + QByteArray::number(address, 16)) : QByteArray();
+ if (address)
+ return QByteArray("0x") + QByteArray::number(address, 16);
+ return QByteArray();
}
QByteArray WatchData::hexReferencingAddress() const
{
- return referencingAddress ? (QByteArray("0x") + QByteArray::number(referencingAddress, 16)) : QByteArray();
+ if (referencingAddress)
+ return QByteArray("0x") + QByteArray::number(referencingAddress, 16);
+ return QByteArray();
}
} // namespace Internal