fixes #369
- fix: Breakpoint condition expression that contains spaces doesn't work. - enhancement: Double click on breakpoint table's condition cell to modify it.
This commit is contained in:
parent
726043d144
commit
3e1e4b0f01
2
NEWS.md
2
NEWS.md
|
@ -115,6 +115,8 @@ Red Panda C++ Version 2.27
|
||||||
- enhancement: Set shortcuts for tools menu item.
|
- enhancement: Set shortcuts for tools menu item.
|
||||||
- enhancement: Enhancement for custom tools.
|
- enhancement: Enhancement for custom tools.
|
||||||
- fix: Can't correctly undo/redo "Delete current line".
|
- fix: Can't correctly undo/redo "Delete current line".
|
||||||
|
- fix: Breakpoint condition expression that contains spaces doesn't work.
|
||||||
|
- enhancement: Double click on breakpoint table's condition cell to modify it.
|
||||||
|
|
||||||
Red Panda C++ Version 2.26
|
Red Panda C++ Version 2.26
|
||||||
- enhancement: Code suggestion for embedded std::vectors.
|
- enhancement: Code suggestion for embedded std::vectors.
|
||||||
|
|
|
@ -1107,7 +1107,7 @@ void GDBMIDebuggerClient::addBreakpoint(PBreakpoint breakpoint)
|
||||||
// break "filename":linenum
|
// break "filename":linenum
|
||||||
QString condition;
|
QString condition;
|
||||||
if (!breakpoint->condition.isEmpty()) {
|
if (!breakpoint->condition.isEmpty()) {
|
||||||
condition = " -c " + breakpoint->condition;
|
condition = QString(" -c \"%1\"").arg(breakpoint->condition);
|
||||||
}
|
}
|
||||||
QString filename = breakpoint->filename;
|
QString filename = breakpoint->filename;
|
||||||
filename.replace('\\','/');
|
filename.replace('\\','/');
|
||||||
|
@ -1145,7 +1145,7 @@ void GDBMIDebuggerClient::setBreakpointCondition(PBreakpoint breakpoint)
|
||||||
QString("%1").arg(breakpoint->number));
|
QString("%1").arg(breakpoint->number));
|
||||||
} else {
|
} else {
|
||||||
postCommand("-break-condition",
|
postCommand("-break-condition",
|
||||||
QString("%1 %2").arg(breakpoint->number).arg(condition));
|
QString("%1 \"%2\"").arg(breakpoint->number).arg(condition));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -208,6 +208,8 @@ MainWindow::MainWindow(QWidget *parent)
|
||||||
delete m;
|
delete m;
|
||||||
ui->tblBreakpoints->setTextElideMode(Qt::ElideRight);
|
ui->tblBreakpoints->setTextElideMode(Qt::ElideRight);
|
||||||
ui->tblBreakpoints->setWordWrap(false);
|
ui->tblBreakpoints->setWordWrap(false);
|
||||||
|
connect(ui->tblBreakpoints, &QTableView::doubleClicked,
|
||||||
|
this, &MainWindow::onBreakpointTableDoubleClicked);
|
||||||
|
|
||||||
m=ui->tblStackTrace->selectionModel();
|
m=ui->tblStackTrace->selectionModel();
|
||||||
ui->tblStackTrace->setModel(mDebugger->backtraceModel().get());
|
ui->tblStackTrace->setModel(mDebugger->backtraceModel().get());
|
||||||
|
@ -3016,7 +3018,7 @@ void MainWindow::createCustomActions()
|
||||||
tr("Breakpoint condition..."),
|
tr("Breakpoint condition..."),
|
||||||
ui->tblBreakpoints);
|
ui->tblBreakpoints);
|
||||||
connect(mBreakpointViewPropertyAction,&QAction::triggered,
|
connect(mBreakpointViewPropertyAction,&QAction::triggered,
|
||||||
this, &MainWindow::onBreakpointViewProperty);
|
this, &MainWindow::onModifyBreakpointCondition);
|
||||||
|
|
||||||
mBreakpointViewRemoveAllAction = createAction(
|
mBreakpointViewRemoveAllAction = createAction(
|
||||||
tr("Remove All Breakpoints"),
|
tr("Remove All Breakpoints"),
|
||||||
|
@ -4815,6 +4817,13 @@ void MainWindow::onDebugConsoleClear()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::onBreakpointTableDoubleClicked(const QModelIndex &index)
|
||||||
|
{
|
||||||
|
if (index.isValid() && index.column()==2) {
|
||||||
|
modifyBreakpointCondition(index.row());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void MainWindow::onFilesViewOpenInExplorer()
|
void MainWindow::onFilesViewOpenInExplorer()
|
||||||
{
|
{
|
||||||
QString path = mFileSystemModel.filePath(ui->treeFiles->currentIndex());
|
QString path = mFileSystemModel.filePath(ui->treeFiles->currentIndex());
|
||||||
|
@ -5079,25 +5088,11 @@ void MainWindow::onBreakpointViewRemoveAll()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::onBreakpointViewProperty()
|
void MainWindow::onModifyBreakpointCondition()
|
||||||
{
|
{
|
||||||
int index =ui->tblBreakpoints->selectionModel()->currentIndex().row();
|
int index =ui->tblBreakpoints->selectionModel()->currentIndex().row();
|
||||||
|
|
||||||
PBreakpoint breakpoint = debugger()->breakpointModel()->breakpoint(
|
modifyBreakpointCondition(index);
|
||||||
index,
|
|
||||||
debugger()->isForProject()
|
|
||||||
);
|
|
||||||
if (breakpoint) {
|
|
||||||
bool isOk;
|
|
||||||
QString s=QInputDialog::getText(this,
|
|
||||||
tr("Break point condition"),
|
|
||||||
tr("Enter the condition of the breakpoint:"),
|
|
||||||
QLineEdit::Normal,
|
|
||||||
breakpoint->condition,&isOk);
|
|
||||||
if (isOk) {
|
|
||||||
pMainWindow->debugger()->setBreakPointCondition(index,s,debugger()->isForProject());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::onSearchViewClearAll()
|
void MainWindow::onSearchViewClearAll()
|
||||||
|
@ -7835,6 +7830,26 @@ QString MainWindow::switchHeaderSourceTarget(Editor *editor)
|
||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::modifyBreakpointCondition(int index)
|
||||||
|
{
|
||||||
|
PBreakpoint breakpoint = debugger()->breakpointModel()->breakpoint(
|
||||||
|
index,
|
||||||
|
debugger()->isForProject()
|
||||||
|
);
|
||||||
|
if (breakpoint) {
|
||||||
|
bool isOk;
|
||||||
|
QString s=QInputDialog::getText(this,
|
||||||
|
tr("Break point condition"),
|
||||||
|
tr("Enter the condition of the breakpoint:"),
|
||||||
|
QLineEdit::Normal,
|
||||||
|
breakpoint->condition,&isOk);
|
||||||
|
if (isOk) {
|
||||||
|
debugger()->setBreakPointCondition(index,s,debugger()->isForProject());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void MainWindow::setupSlotsForProject()
|
void MainWindow::setupSlotsForProject()
|
||||||
{
|
{
|
||||||
connect(mProject.get(), &Project::unitAdded,
|
connect(mProject.get(), &Project::unitAdded,
|
||||||
|
|
|
@ -333,6 +333,8 @@ private:
|
||||||
void reparseNonProjectEditors();
|
void reparseNonProjectEditors();
|
||||||
QString switchHeaderSourceTarget(Editor *editor);
|
QString switchHeaderSourceTarget(Editor *editor);
|
||||||
|
|
||||||
|
void modifyBreakpointCondition(int index);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void setupSlotsForProject();
|
void setupSlotsForProject();
|
||||||
void onProjectUnitAdded(const QString &filename);
|
void onProjectUnitAdded(const QString &filename);
|
||||||
|
@ -400,6 +402,7 @@ private slots:
|
||||||
void onDebugConsoleSelectAll();
|
void onDebugConsoleSelectAll();
|
||||||
void onDebugConsoleCopy();
|
void onDebugConsoleCopy();
|
||||||
void onDebugConsoleClear();
|
void onDebugConsoleClear();
|
||||||
|
void onBreakpointTableDoubleClicked(const QModelIndex& index);
|
||||||
void onFilesViewOpenInExplorer();
|
void onFilesViewOpenInExplorer();
|
||||||
void onFilesViewOpenInTerminal();
|
void onFilesViewOpenInTerminal();
|
||||||
void onFilesViewOpenWithExternal();
|
void onFilesViewOpenWithExternal();
|
||||||
|
@ -421,7 +424,7 @@ private slots:
|
||||||
void onProjectRenameUnit();
|
void onProjectRenameUnit();
|
||||||
void onBreakpointRemove();
|
void onBreakpointRemove();
|
||||||
void onBreakpointViewRemoveAll();
|
void onBreakpointViewRemoveAll();
|
||||||
void onBreakpointViewProperty();
|
void onModifyBreakpointCondition();
|
||||||
void onSearchViewClearAll();
|
void onSearchViewClearAll();
|
||||||
void onSearchViewClear();
|
void onSearchViewClear();
|
||||||
void onTableIssuesClear();
|
void onTableIssuesClear();
|
||||||
|
|
Loading…
Reference in New Issue