Add 'catchpoint' support.

Still working on Editor config options.
This commit is contained in:
Ernie Pasveer
2021-12-31 13:00:54 -06:00
parent 07f2f0176b
commit 7449fc7e66
12 changed files with 372 additions and 681 deletions
+42 -151
View File
@@ -7,201 +7,92 @@ SeerCatchpointCreateDialog::SeerCatchpointCreateDialog (QWidget* parent) : QDial
setupUi(this);
// Setup the widgets
setFilename("");
setFunctionName("");
setLabelName("");
setLineNumber("");
setType("");
setNameText("");
setTemporaryEnabled (false);
setHardwareEnabled (false);
setPendingEnabled (false);
setDisabledEnabled (false);
setConditionalEnabled (false);
setIgnoreCountEnabled (false);
setThreadIdEnabled (false);
setConditionalText ("");
setIgnoreCountText ("");
setThreadIdText ("");
setNameEnabled (false);
// Connect things.
QObject::connect(conditionalCheckBox, &QCheckBox::clicked, conditionalLineEdit, &QLineEdit::setEnabled);
QObject::connect(ignoreCountCheckBox, &QCheckBox::clicked, ignoreCountLineEdit, &QLineEdit::setEnabled);
QObject::connect(threadIdCheckBox, &QCheckBox::clicked, threadIdLineEdit, &QLineEdit::setEnabled);
QObject::connect(nameCheckBox, &QCheckBox::clicked, nameLineEdit, &QLineEdit::setEnabled);
}
SeerCatchpointCreateDialog::~SeerCatchpointCreateDialog () {
}
void SeerCatchpointCreateDialog::setFilename (const QString& text) {
filenameLineEdit->setText(text);
void SeerCatchpointCreateDialog::setType (const QString& text) {
if (text == "throw") {
throwRadioButton->setChecked(true);
}else if (text == "rethrow") {
rethrowRadioButton->setChecked(true);
}else if (text == "catch") {
catchRadioButton->setChecked(true);
}else{
throwRadioButton->setChecked(true);
}
}
void SeerCatchpointCreateDialog::setFunctionName (const QString& text) {
functionLineEdit->setText(text);
}
QString SeerCatchpointCreateDialog::typeText () const {
void SeerCatchpointCreateDialog::setLabelName (const QString& text) {
labelLineEdit->setText(text);
}
if (throwRadioButton->isChecked()) {
return "throw";
void SeerCatchpointCreateDialog::setLineNumber (const QString& text) {
lineNumberLineEdit->setText(text);
}
}else if (rethrowRadioButton->isChecked()) {
return "rethrow";
QString SeerCatchpointCreateDialog::filenameText () const {
return filenameLineEdit->text();
}
}else if (catchRadioButton->isChecked()) {
return "catch";
QString SeerCatchpointCreateDialog::functionNameText () const {
return functionLineEdit->text();
}
QString SeerCatchpointCreateDialog::labelNameText () const {
return labelLineEdit->text();
}
QString SeerCatchpointCreateDialog::lineNumberText () const {
return lineNumberLineEdit->text();
}else{
return "throw";
}
}
void SeerCatchpointCreateDialog::setTemporaryEnabled (bool flag) {
temporaryCheckBox->setChecked(flag);
}
void SeerCatchpointCreateDialog::setHardwareEnabled (bool flag) {
hardwareCheckBox->setChecked(flag);
void SeerCatchpointCreateDialog::setNameEnabled (bool flag) {
nameCheckBox->setChecked(flag);
nameLineEdit->setEnabled(flag);
}
void SeerCatchpointCreateDialog::setPendingEnabled (bool flag) {
pendingCheckBox->setChecked(flag);
void SeerCatchpointCreateDialog::setNameText (const QString& text) {
nameLineEdit->setText(text);
}
void SeerCatchpointCreateDialog::setDisabledEnabled (bool flag) {
disabledCheckBox->setChecked(flag);
}
void SeerCatchpointCreateDialog::setConditionalEnabled (bool flag) {
conditionalCheckBox->setChecked(flag);
conditionalLineEdit->setEnabled(flag);
}
void SeerCatchpointCreateDialog::setIgnoreCountEnabled (bool flag) {
ignoreCountCheckBox->setChecked(flag);
ignoreCountLineEdit->setEnabled(flag);
}
void SeerCatchpointCreateDialog::setThreadIdEnabled (bool flag) {
threadIdCheckBox->setChecked(flag);
threadIdLineEdit->setEnabled(flag);
}
void SeerCatchpointCreateDialog::setConditionalText (const QString& text) {
conditionalLineEdit->setText(text);
}
void SeerCatchpointCreateDialog::setIgnoreCountText (const QString& text) {
ignoreCountLineEdit->setText(text);
}
void SeerCatchpointCreateDialog::setThreadIdText (const QString& text) {
threadIdLineEdit->setText(text);
QString SeerCatchpointCreateDialog::nameText () const {
return nameLineEdit->text();
}
bool SeerCatchpointCreateDialog::temporaryEnabled () const {
return temporaryCheckBox->isChecked();
}
bool SeerCatchpointCreateDialog::hardwareEnabled () const {
return hardwareCheckBox->isChecked();
}
bool SeerCatchpointCreateDialog::pendingEnabled () const {
return pendingCheckBox->isChecked();
}
bool SeerCatchpointCreateDialog::disabledEnabled () const {
return disabledCheckBox->isChecked();
}
bool SeerCatchpointCreateDialog::conditionalEnabled () const {
return conditionalCheckBox->isChecked();
}
bool SeerCatchpointCreateDialog::ignoreCountEnabled () const {
return ignoreCountCheckBox->isChecked();
}
bool SeerCatchpointCreateDialog::threadIdEnabled () const {
return threadIdCheckBox->isChecked();
}
QString SeerCatchpointCreateDialog::conditionalText () const {
return conditionalLineEdit->text();
}
QString SeerCatchpointCreateDialog::ignoreCountText () const {
return ignoreCountLineEdit->text();
}
QString SeerCatchpointCreateDialog::threadIdText () const {
return threadIdLineEdit->text();
bool SeerCatchpointCreateDialog::nameEnabled () const {
return nameCheckBox->isChecked();
}
QString SeerCatchpointCreateDialog::catchpointText () const {
// Build a catchpoint specification.
QString catchpointParameters;
QString catchpointParameters = typeText();
if (temporaryEnabled()) {
catchpointParameters += " -t";
}
if (hardwareEnabled()) {
catchpointParameters += " -h";
}
if (pendingEnabled()) {
catchpointParameters += " -f";
}
if (disabledEnabled()) {
catchpointParameters += " -d";
}
if (conditionalEnabled()) {
if (conditionalText() != "") {
catchpointParameters += " -c " + conditionalText();
if (nameEnabled()) {
if (nameText() != "") {
catchpointParameters += " -r " + nameText();
}
}
if (ignoreCountEnabled()) {
if (ignoreCountText() != "") {
catchpointParameters += " -i " + ignoreCountText();
}
}
if (threadIdEnabled()) {
if (threadIdText() != "") {
catchpointParameters += " -p " + threadIdText();
}
}
if (filenameText() != "") {
catchpointParameters += " --source " + filenameText();
}
if (functionNameText() != "") {
catchpointParameters += " --function " + functionNameText();
}
if (labelNameText() != "") {
catchpointParameters += " --label " + labelNameText();
}
if (lineNumberText() != "") {
catchpointParameters += " --line " + lineNumberText();
}
//qDebug() << __PRETTY_FUNCTION__ << ":" << catchpointParameters;
return catchpointParameters;
}