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:
hjk
2015-02-18 11:35:25 +01:00
committed by David Schulz
parent c3184ee790
commit 23ad61fc9d
2 changed files with 14 additions and 20 deletions

View File

@@ -2040,9 +2040,15 @@ unsigned CdbEngine::examineStopReason(const GdbMi &stopReason,
if (!conditionalBreakPointTriggered && !parameters.condition.isEmpty()) { if (!conditionalBreakPointTriggered && !parameters.condition.isEmpty()) {
*message = msgCheckingConditionalBreakPoint(id, number, parameters.condition, *message = msgCheckingConditionalBreakPoint(id, number, parameters.condition,
QString::number(threadId)); QString::number(threadId));
ConditionalBreakPointCookie cookie(id);
cookie.stopReason = stopReason; QByteArray exp = parameters.condition;
evaluateExpression(parameters.condition, cookie); 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; return StopReportLog;
} }
} else { } 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; int value = 0;
if (command->success) if (command->success)
@@ -3091,27 +3097,17 @@ void CdbEngine::handleExpression(const CdbCommandPtr &command, const Conditional
// Is this a conditional breakpoint? // Is this a conditional breakpoint?
const QString message = value ? const QString message = value ?
tr("Value %1 obtained from evaluating the condition of breakpoint %2, stopping."). 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."). tr("Value 0 obtained from evaluating the condition of breakpoint %1, continuing.").
arg(cookie.id.toString()); arg(id.toString());
showMessage(message, LogMisc); showMessage(message, LogMisc);
// Stop if evaluation is true, else continue // Stop if evaluation is true, else continue
if (value) if (value)
processStop(cookie.stopReason, true); processStop(stopReason, true);
else else
doContinueInferior(); 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) void CdbEngine::dummyHandler(const CdbCommandPtr &command)
{ {
postCommandSequence(command->commandSequence); postCommandSequence(command->commandSequence);

View File

@@ -51,7 +51,6 @@ namespace Internal {
class DisassemblerAgent; class DisassemblerAgent;
struct CdbCommand; struct CdbCommand;
struct MemoryViewCookie; struct MemoryViewCookie;
struct ConditionalBreakPointCookie;
class ByteArrayInputStream; class ByteArrayInputStream;
class GdbMi; class GdbMi;
@@ -215,14 +214,13 @@ private:
DisassemblerAgent *agent); DisassemblerAgent *agent);
void postResolveSymbol(const QString &module, const QString &function, void postResolveSymbol(const QString &module, const QString &function,
DisassemblerAgent *agent); DisassemblerAgent *agent);
void evaluateExpression(QByteArray exp, const ConditionalBreakPointCookie &cookie);
// Builtin commands // Builtin commands
void dummyHandler(const CdbCommandPtr &); void dummyHandler(const CdbCommandPtr &);
void handleStackTrace(const CdbCommandPtr &); void handleStackTrace(const CdbCommandPtr &);
void handleRegisters(const CdbCommandPtr &); void handleRegisters(const CdbCommandPtr &);
void handleDisassembler(const CdbCommandPtr &, DisassemblerAgent *agent); void handleDisassembler(const CdbCommandPtr &, DisassemblerAgent *agent);
void handleJumpToLineAddressResolution(const CdbCommandPtr &, const ContextData &context); 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 handleResolveSymbol(const CdbCommandPtr &command, const QString &symbol, DisassemblerAgent *agent);
void handleResolveSymbolHelper(const QList<quint64> &addresses, DisassemblerAgent *agent); void handleResolveSymbolHelper(const QList<quint64> &addresses, DisassemblerAgent *agent);
void handleBreakInsert(const CdbCommandPtr &cmd); void handleBreakInsert(const CdbCommandPtr &cmd);