forked from qt-creator/qt-creator
Debugger: Dissolve ConditionalBreakPointCookie structure
After dropping the QVariant cookies the structure is not needed. Change-Id: Ib6f702bedeb250518ac0b7019e32d2caa62eb616 Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
This commit is contained in:
@@ -2040,9 +2040,15 @@ unsigned CdbEngine::examineStopReason(const GdbMi &stopReason,
|
||||
if (!conditionalBreakPointTriggered && !parameters.condition.isEmpty()) {
|
||||
*message = msgCheckingConditionalBreakPoint(id, number, parameters.condition,
|
||||
QString::number(threadId));
|
||||
ConditionalBreakPointCookie cookie(id);
|
||||
cookie.stopReason = stopReason;
|
||||
evaluateExpression(parameters.condition, cookie);
|
||||
|
||||
QByteArray exp = parameters.condition;
|
||||
if (exp.contains(' ') && !exp.startsWith('"')) {
|
||||
exp.prepend('"');
|
||||
exp.append('"');
|
||||
}
|
||||
postExtensionCommand("expression", exp, 0,
|
||||
[this, id, stopReason](const CdbCommandPtr &r) { handleExpression(r, id, stopReason); });
|
||||
|
||||
return StopReportLog;
|
||||
}
|
||||
} else {
|
||||
@@ -3081,7 +3087,7 @@ void CdbEngine::handleStackTrace(const CdbCommandPtr &command)
|
||||
}
|
||||
}
|
||||
|
||||
void CdbEngine::handleExpression(const CdbCommandPtr &command, const ConditionalBreakPointCookie &cookie)
|
||||
void CdbEngine::handleExpression(const CdbCommandPtr &command, BreakpointModelId id, const GdbMi &stopReason)
|
||||
{
|
||||
int value = 0;
|
||||
if (command->success)
|
||||
@@ -3091,27 +3097,17 @@ void CdbEngine::handleExpression(const CdbCommandPtr &command, const Conditional
|
||||
// Is this a conditional breakpoint?
|
||||
const QString message = value ?
|
||||
tr("Value %1 obtained from evaluating the condition of breakpoint %2, stopping.").
|
||||
arg(value).arg(cookie.id.toString()) :
|
||||
arg(value).arg(id.toString()) :
|
||||
tr("Value 0 obtained from evaluating the condition of breakpoint %1, continuing.").
|
||||
arg(cookie.id.toString());
|
||||
arg(id.toString());
|
||||
showMessage(message, LogMisc);
|
||||
// Stop if evaluation is true, else continue
|
||||
if (value)
|
||||
processStop(cookie.stopReason, true);
|
||||
processStop(stopReason, true);
|
||||
else
|
||||
doContinueInferior();
|
||||
}
|
||||
|
||||
void CdbEngine::evaluateExpression(QByteArray exp, const ConditionalBreakPointCookie &cookie)
|
||||
{
|
||||
if (exp.contains(' ') && !exp.startsWith('"')) {
|
||||
exp.prepend('"');
|
||||
exp.append('"');
|
||||
}
|
||||
postExtensionCommand("expression", exp, 0,
|
||||
[this, cookie](const CdbCommandPtr &r) { handleExpression(r, cookie); });
|
||||
}
|
||||
|
||||
void CdbEngine::dummyHandler(const CdbCommandPtr &command)
|
||||
{
|
||||
postCommandSequence(command->commandSequence);
|
||||
|
@@ -51,7 +51,6 @@ namespace Internal {
|
||||
class DisassemblerAgent;
|
||||
struct CdbCommand;
|
||||
struct MemoryViewCookie;
|
||||
struct ConditionalBreakPointCookie;
|
||||
class ByteArrayInputStream;
|
||||
class GdbMi;
|
||||
|
||||
@@ -215,14 +214,13 @@ private:
|
||||
DisassemblerAgent *agent);
|
||||
void postResolveSymbol(const QString &module, const QString &function,
|
||||
DisassemblerAgent *agent);
|
||||
void evaluateExpression(QByteArray exp, const ConditionalBreakPointCookie &cookie);
|
||||
// Builtin commands
|
||||
void dummyHandler(const CdbCommandPtr &);
|
||||
void handleStackTrace(const CdbCommandPtr &);
|
||||
void handleRegisters(const CdbCommandPtr &);
|
||||
void handleDisassembler(const CdbCommandPtr &, DisassemblerAgent *agent);
|
||||
void handleJumpToLineAddressResolution(const CdbCommandPtr &, const ContextData &context);
|
||||
void handleExpression(const CdbCommandPtr &, const ConditionalBreakPointCookie &cookie);
|
||||
void handleExpression(const CdbCommandPtr &command, BreakpointModelId id, const GdbMi &stopReason);
|
||||
void handleResolveSymbol(const CdbCommandPtr &command, const QString &symbol, DisassemblerAgent *agent);
|
||||
void handleResolveSymbolHelper(const QList<quint64> &addresses, DisassemblerAgent *agent);
|
||||
void handleBreakInsert(const CdbCommandPtr &cmd);
|
||||
|
Reference in New Issue
Block a user