Commit efada549 authored by hjk's avatar hjk
Browse files

Debugger: Fix enable state of breakpoint command text field



There was no actual error in practice, as the handling was lumped
together with the tracepoint checkmark, which (accidentally) did the
right thing in all cases.

Change-Id: Icf12aaf0c48855b747d25a0252c8215e259c4227
Reviewed-by: default avatarNiels Weber <niels.weber@theqtcompany.com>
parent af394ecc
......@@ -137,23 +137,23 @@ enum BreakpointPathUsage
enum BreakpointParts
{
NoParts = 0,
FileAndLinePart = 0x1,
FunctionPart = 0x2,
AddressPart = 0x4,
ExpressionPart = 0x8,
ConditionPart = 0x10,
IgnoreCountPart = 0x20,
ThreadSpecPart = 0x40,
ModulePart = 0x80,
TracePointPart = 0x100,
EnabledPart = 0x200,
TypePart = 0x400,
PathUsagePart = 0x800,
CommandPart = 0x1000,
MessagePart = 0x2000,
OneShotPart = 0x4000,
NoParts = 0,
FileAndLinePart = (1 << 0),
FunctionPart = (1 << 1),
AddressPart = (1 << 2),
ExpressionPart = (1 << 3),
ConditionPart = (1 << 4),
IgnoreCountPart = (1 << 5),
ThreadSpecPart = (1 << 6),
ModulePart = (1 << 7),
TracePointPart = (1 << 8),
EnabledPart = (1 << 9),
TypePart = (1 << 10),
PathUsagePart = (1 << 11),
CommandPart = (1 << 12),
MessagePart = (1 << 13),
OneShotPart = (1 << 14),
AllConditionParts = ConditionPart|IgnoreCountPart|ThreadSpecPart
|OneShotPart,
......
......@@ -387,8 +387,8 @@ void BreakpointDialog::setPartsEnabled(unsigned partsMask)
m_checkBoxTracepoint->setEnabled(partsMask & TracePointPart);
m_checkBoxTracepoint->hide();
m_labelCommands->setEnabled(partsMask & TracePointPart);
m_textEditCommands->setEnabled(partsMask & TracePointPart);
m_labelCommands->setEnabled(partsMask & CommandPart);
m_textEditCommands->setEnabled(partsMask & CommandPart);
m_labelMessage->setEnabled(partsMask & TracePointPart);
m_labelMessage->hide();
......@@ -424,9 +424,10 @@ void BreakpointDialog::clearOtherParts(unsigned partsMask)
if (partsMask & OneShotPart)
m_checkBoxOneShot->setChecked(false);
if (invertedPartsMask & CommandPart)
m_textEditCommands->clear();
if (invertedPartsMask & TracePointPart) {
m_checkBoxTracepoint->setChecked(false);
m_textEditCommands->clear();
m_lineEditMessage->clear();
}
}
......@@ -460,9 +461,10 @@ void BreakpointDialog::getParts(unsigned partsMask, BreakpointParameters *data)
if (partsMask & OneShotPart)
data->oneShot = m_checkBoxOneShot->isChecked();
if (partsMask & CommandPart)
data->command = m_textEditCommands->toPlainText().trimmed();
if (partsMask & TracePointPart) {
data->tracepoint = m_checkBoxTracepoint->isChecked();
data->command = m_textEditCommands->toPlainText().trimmed();
data->message = m_lineEditMessage->text();
}
}
......@@ -471,7 +473,6 @@ void BreakpointDialog::setParts(unsigned mask, const BreakpointParameters &data)
{
m_checkBoxEnabled->setChecked(data.enabled);
m_comboBoxPathUsage->setCurrentIndex(data.pathUsage);
m_textEditCommands->setPlainText(data.command);
m_lineEditMessage->setText(data.message);
if (mask & FileAndLinePart) {
......@@ -512,6 +513,8 @@ void BreakpointDialog::setParts(unsigned mask, const BreakpointParameters &data)
m_checkBoxOneShot->setChecked(data.oneShot);
if (mask & TracePointPart)
m_checkBoxTracepoint->setChecked(data.tracepoint);
if (mask & CommandPart)
m_textEditCommands->setPlainText(data.command);
}
void BreakpointDialog::typeChanged(int)
......@@ -525,10 +528,10 @@ void BreakpointDialog::typeChanged(int)
case LastBreakpointType:
break;
case BreakpointByFileAndLine:
getParts(FileAndLinePart|ModulePart|AllConditionParts|TracePointPart, &m_savedParameters);
getParts(FileAndLinePart|ModulePart|AllConditionParts|TracePointPart|CommandPart, &m_savedParameters);
break;
case BreakpointByFunction:
getParts(FunctionPart|ModulePart|AllConditionParts|TracePointPart, &m_savedParameters);
getParts(FunctionPart|ModulePart|AllConditionParts|TracePointPart|CommandPart, &m_savedParameters);
break;
case BreakpointAtThrow:
case BreakpointAtCatch:
......@@ -541,10 +544,10 @@ void BreakpointDialog::typeChanged(int)
break;
case BreakpointByAddress:
case WatchpointAtAddress:
getParts(AddressPart|AllConditionParts|TracePointPart, &m_savedParameters);
getParts(AddressPart|AllConditionParts|TracePointPart|CommandPart, &m_savedParameters);
break;
case WatchpointAtExpression:
getParts(ExpressionPart|AllConditionParts|TracePointPart, &m_savedParameters);
getParts(ExpressionPart|AllConditionParts|TracePointPart|CommandPart, &m_savedParameters);
break;
case BreakpointOnQmlSignalEmit:
getParts(FunctionPart, &m_savedParameters);
......@@ -556,14 +559,14 @@ void BreakpointDialog::typeChanged(int)
case LastBreakpointType:
break;
case BreakpointByFileAndLine:
setParts(FileAndLinePart|AllConditionParts|ModulePart|TracePointPart, m_savedParameters);
setPartsEnabled(FileAndLinePart|AllConditionParts|ModulePart|TracePointPart);
clearOtherParts(FileAndLinePart|AllConditionParts|ModulePart|TracePointPart);
setParts(FileAndLinePart|AllConditionParts|ModulePart|TracePointPart|CommandPart, m_savedParameters);
setPartsEnabled(FileAndLinePart|AllConditionParts|ModulePart|TracePointPart|CommandPart);
clearOtherParts(FileAndLinePart|AllConditionParts|ModulePart|TracePointPart|CommandPart);
break;
case BreakpointByFunction:
setParts(FunctionPart|AllConditionParts|ModulePart|TracePointPart, m_savedParameters);
setPartsEnabled(FunctionPart|AllConditionParts|ModulePart|TracePointPart);
clearOtherParts(FunctionPart|AllConditionParts|ModulePart|TracePointPart);
setParts(FunctionPart|AllConditionParts|ModulePart|TracePointPart|CommandPart, m_savedParameters);
setPartsEnabled(FunctionPart|AllConditionParts|ModulePart|TracePointPart|CommandPart);
clearOtherParts(FunctionPart|AllConditionParts|ModulePart|TracePointPart|CommandPart);
break;
case BreakpointAtThrow:
case BreakpointAtCatch:
......@@ -571,8 +574,8 @@ void BreakpointDialog::typeChanged(int)
case BreakpointAtExec:
//case BreakpointAtVFork:
case BreakpointAtSysCall:
clearOtherParts(AllConditionParts|ModulePart|TracePointPart);
setPartsEnabled(AllConditionParts|TracePointPart);
clearOtherParts(AllConditionParts|ModulePart|TracePointPart|CommandPart);
setPartsEnabled(AllConditionParts|TracePointPart|CommandPart);
break;
case BreakpointAtJavaScriptThrow:
clearOtherParts(AllParts);
......@@ -585,14 +588,14 @@ void BreakpointDialog::typeChanged(int)
break;
case BreakpointByAddress:
case WatchpointAtAddress:
setParts(AddressPart|AllConditionParts|TracePointPart, m_savedParameters);
setPartsEnabled(AddressPart|AllConditionParts|TracePointPart);
clearOtherParts(AddressPart|AllConditionParts|TracePointPart);
setParts(AddressPart|AllConditionParts|TracePointPart|CommandPart, m_savedParameters);
setPartsEnabled(AddressPart|AllConditionParts|TracePointPart|CommandPart);
clearOtherParts(AddressPart|AllConditionParts|TracePointPart|CommandPart);
break;
case WatchpointAtExpression:
setParts(ExpressionPart|AllConditionParts|TracePointPart, m_savedParameters);
setPartsEnabled(ExpressionPart|AllConditionParts|TracePointPart);
clearOtherParts(ExpressionPart|AllConditionParts|TracePointPart);
setParts(ExpressionPart|AllConditionParts|TracePointPart|CommandPart, m_savedParameters);
setPartsEnabled(ExpressionPart|AllConditionParts|TracePointPart|CommandPart);
clearOtherParts(ExpressionPart|AllConditionParts|TracePointPart|CommandPart);
break;
case BreakpointOnQmlSignalEmit:
setParts(FunctionPart, m_savedParameters);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment