Skip to content

Commit

Permalink
Merge pull request #277 from epasveer/31-printpoint-fail-with-syntax-…
Browse files Browse the repository at this point in the history
…error

31 printpoint fail with syntax error
  • Loading branch information
epasveer authored Dec 23, 2024
2 parents 9d7185a + 1c6ba13 commit 54172ea
Show file tree
Hide file tree
Showing 35 changed files with 722 additions and 376 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
* Source all files in ~/.config/seergdb/scripts/ on startup.
* Fixed regression handling ignoring of system header files.
* Fixed regression when adding commands to a breakpoint.
* Refactored/improved Printpoints. Added 'help' to the
Printpoint create dialog.

## [2.4] - 2024-03-18
* Changed main icon to a more license friendly one.
Expand Down
30 changes: 0 additions & 30 deletions src/SeerConfigDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,36 +230,6 @@ bool SeerConfigDialog::gdbEnablePrettyPrinting () const {
return _gdbConfigPage->gdbEnablePrettyPrinting();
}

void SeerConfigDialog::setDprintfStyle (const QString& style) {

_gdbConfigPage->setDprintfStyle(style);
}

QString SeerConfigDialog::dprintfStyle () const {

return _gdbConfigPage->dprintfStyle();
}

void SeerConfigDialog::setDprintfFunction (const QString& function) {

_gdbConfigPage->setDprintfFunction(function);
}

QString SeerConfigDialog::dprintfFunction () const {

return _gdbConfigPage->dprintfFunction();
}

void SeerConfigDialog::setDprintfChannel (const QString& channel) {

_gdbConfigPage->setDprintfChannel(channel);
}

QString SeerConfigDialog::dprintfChannel () const {

return _gdbConfigPage->dprintfChannel();
}

void SeerConfigDialog::setEditorFont (const QFont& font) {

_editorConfigPage->setEditorFont(font);
Expand Down
9 changes: 0 additions & 9 deletions src/SeerConfigDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,6 @@ class SeerConfigDialog : public QDialog, protected Ui::SeerConfigDialogForm {
void setGdbEnablePrettyPrinting (bool flag);
bool gdbEnablePrettyPrinting () const;

void setDprintfStyle (const QString& style);
QString dprintfStyle () const;

void setDprintfFunction (const QString& function);
QString dprintfFunction () const;

void setDprintfChannel (const QString& channel);
QString dprintfChannel () const;

// Editor settings.
void setEditorFont (const QFont& font);
const QFont& editorFont () const;
Expand Down
4 changes: 2 additions & 2 deletions src/SeerEditorManagerWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1179,10 +1179,10 @@ void SeerEditorManagerWidget::handleInsertBreakpoint (QString breakpoint) {
emit insertBreakpoint (breakpoint);
}

void SeerEditorManagerWidget::handleInsertPrintpoint (QString printpoint) {
void SeerEditorManagerWidget::handleInsertPrintpoint (QString type, QString function, QString channel, QString parameters) {

// rethrow
emit insertPrintpoint (printpoint);
emit insertPrintpoint (type, function, channel, parameters);
}

void SeerEditorManagerWidget::handleDeleteBreakpoints (QString breakpoints) {
Expand Down
4 changes: 2 additions & 2 deletions src/SeerEditorManagerWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class SeerEditorManagerWidget : public QWidget, protected Ui::SeerEditorManagerW
void handleOpenFile (const QString& file, const QString& fullname, int lineno);
void handleOpenAddress (const QString& address);
void handleInsertBreakpoint (QString breakpoint);
void handleInsertPrintpoint (QString printpoint);
void handleInsertPrintpoint (QString type, QString function, QString channel, QString parameters);
void handleDeleteBreakpoints (QString breakpoints);
void handleEnableBreakpoints (QString breakpoints);
void handleDisableBreakpoints (QString breakpoints);
Expand Down Expand Up @@ -101,7 +101,7 @@ class SeerEditorManagerWidget : public QWidget, protected Ui::SeerEditorManagerW
void refreshBreakpointsList ();
void refreshStackFrames ();
void insertBreakpoint (QString breakpoint);
void insertPrintpoint (QString printpoint);
void insertPrintpoint (QString type, QString function, QString channel, QString parameters);
void deleteBreakpoints (QString breakpoints);
void enableBreakpoints (QString breakpoints);
void disableBreakpoints (QString breakpoints);
Expand Down
2 changes: 1 addition & 1 deletion src/SeerEditorWidgetSource.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class SeerEditorWidgetSourceArea : public SeerPlainTextEdit {

signals:
void insertBreakpoint (QString breakpoint);
void insertPrintpoint (QString printpoint);
void insertPrintpoint (QString type, QString function, QString channel, QString parameters);
void deleteBreakpoints (QString breakpoints);
void enableBreakpoints (QString breakpoints);
void disableBreakpoints (QString breakpoints);
Expand Down
13 changes: 12 additions & 1 deletion src/SeerEditorWidgetSourceAreas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1259,8 +1259,19 @@ void SeerEditorWidgetSourceArea::showContextMenu (const QPoint& pos, const QPoin
return;
}

// Build a printpoint specification.
QString type = dlg.dprintfType();
QString function = dlg.dprintfFunction();
QString channel = dlg.dprintfChannel();
QString parameters = dlg.printpointParameters();

// If nothing, just return.
if (parameters == "" || type == "") {
return;
}

// Emit the create breakpoint signal.
emit insertPrintpoint(dlg.printpointText());
emit insertPrintpoint(type, function, channel, parameters);

return;
}
Expand Down
65 changes: 1 addition & 64 deletions src/SeerGdbConfigPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ SeerGdbConfigPage::SeerGdbConfigPage(QWidget* parent) : QWidget(parent) {
setupUi(this);

// Connect things.
QObject::connect(gdbProgramToolButton, &QToolButton::clicked, this, &SeerGdbConfigPage::handleGdbProgramToolButton);
QObject::connect(styleButtonGroup, QOverload<int>::of(&QButtonGroup::idClicked), this, &SeerGdbConfigPage::handleDprintfButtonGroup);
QObject::connect(gdbProgramToolButton, &QToolButton::clicked, this, &SeerGdbConfigPage::handleGdbProgramToolButton);

// Setup the defaults.
reset();
Expand Down Expand Up @@ -89,53 +88,6 @@ void SeerGdbConfigPage::setGdbEnablePrettyPrinting (bool flag) {
gdbEnablePrettyPrintingCheckBox->setChecked(flag);
}

QString SeerGdbConfigPage::dprintfStyle () const {

if (styleGdbRadioButton->isChecked()) {
return "gdb";
}else if (styleCallRadioButton->isChecked()) {
return "call";
}else if (styleAgentRadioButton->isChecked()) {
return "agent";
}else{
return "";
}
}

QString SeerGdbConfigPage::dprintfFunction () const {

return functionLineEdit->text();
}

QString SeerGdbConfigPage::dprintfChannel () const {

return channelLineEdit->text();
}

void SeerGdbConfigPage::setDprintfStyle (const QString& style) {

if (style == "gdb") {
styleGdbRadioButton->setChecked(true);
}else if (style == "call") {
styleCallRadioButton->setChecked(true);
}else if (style == "agent") {
styleAgentRadioButton->setChecked(true);
}else{
}

handleDprintfButtonGroup();
}

void SeerGdbConfigPage::setDprintfFunction (const QString& function) {

functionLineEdit->setText(function);
}

void SeerGdbConfigPage::setDprintfChannel (const QString& channel) {

channelLineEdit->setText(channel);
}

void SeerGdbConfigPage::reset () {

setGdbProgram("/usr/bin/gdb");
Expand All @@ -145,10 +97,6 @@ void SeerGdbConfigPage::reset () {
setGdbHandleTerminatingException(true);
setGdbRandomizeStartAddress(false);
setGdbEnablePrettyPrinting(true);

setDprintfStyle("gdb");
setDprintfFunction("printf");
setDprintfChannel("");
}

void SeerGdbConfigPage::handleGdbProgramToolButton () {
Expand All @@ -160,14 +108,3 @@ void SeerGdbConfigPage::handleGdbProgramToolButton () {
}
}

void SeerGdbConfigPage::handleDprintfButtonGroup () {

functionLineEdit->setEnabled(false);
channelLineEdit->setEnabled(false);

if (styleCallRadioButton->isChecked()) {
functionLineEdit->setEnabled(true);
channelLineEdit->setEnabled(true);
}
}

9 changes: 0 additions & 9 deletions src/SeerGdbConfigPage.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,9 @@ class SeerGdbConfigPage : public QWidget, protected Ui::SeerGdbConfigPage {
void setGdbRandomizeStartAddress (bool flag);
void setGdbEnablePrettyPrinting (bool flag);

QString dprintfStyle () const;
QString dprintfFunction () const;
QString dprintfChannel () const;

void setDprintfStyle (const QString& style);
void setDprintfFunction (const QString& function);
void setDprintfChannel (const QString& channel);

void reset ();

protected slots:
void handleGdbProgramToolButton ();
void handleDprintfButtonGroup ();
};

Loading

0 comments on commit 54172ea

Please sign in to comment.