- enhancement: project and non-project files use different breakpoint and watchvar view (auto switch when not debugging and editor switched)

- enhancement: save project's breakpoint and watchvar in it's own debug file.
  - enhancement: delete a watch expression don't reload who watch var view
This commit is contained in:
Roy Qu 2022-10-16 23:10:57 +08:00
parent 7883397409
commit 984d10eaf1
12 changed files with 633 additions and 392 deletions

View File

@ -16,7 +16,9 @@ Red Panda C++ Version 1.5
- fix: icons in options dialogs not correctly updated when change icon set
- enhancement: set compilation stage in the options / compiler set pages
- enhancement: set custom compilation output suffix in the options / compiler set pages
- enhancement: project and non-project files use different breakpoint and watchvar view (auto switch when not debugging and editor switched)
- enhancement: save project's breakpoint and watchvar in it's own debug file.
- enhancement: delete a watch expression don't reload who watch var view
Red Panda C++ Version 1.4

File diff suppressed because it is too large Load Diff

View File

@ -56,7 +56,8 @@ struct WatchVar {
QString type;
int numChild;
QList<PWatchVar> children;
WatchVar * parent; //use raw point to prevent circular-reference
std::weak_ptr<WatchVar> parent; //use raw point to prevent circular-reference
qint64 timestamp;
};
enum class BreakpointType {
@ -75,10 +76,20 @@ struct Breakpoint {
QString condition;
bool enabled;
BreakpointType breakpointType;
qint64 timestamp;
};
using PBreakpoint = std::shared_ptr<Breakpoint>;
struct DebugConfig {
QList<PBreakpoint> breakpoints;
QList<PWatchVar> watchVars;
qint64 timestamp;
};
using PDebugConfig=std::shared_ptr<DebugConfig>;
struct Trace {
QString funcname;
QString filename;
@ -105,6 +116,8 @@ private:
QHash<int,QString> mRegisterValues;
};
class Debugger;
class BreakpointModel: public QAbstractTableModel {
Q_OBJECT
// QAbstractItemModel interface
@ -114,21 +127,34 @@ public:
int columnCount(const QModelIndex &parent) const override;
QVariant data(const QModelIndex &index, int role) const override;
QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
void addBreakpoint(PBreakpoint p);
void clear();
void removeBreakpoint(int index);
PBreakpoint setBreakPointCondition(int index, const QString& condition);
const QList<PBreakpoint>& breakpoints() const;
PBreakpoint breakpoint(int index) const;
void save(const QString& filename);
void load(const QString& filename);
void addBreakpoint(PBreakpoint p, bool forProject);
void clear(bool forProject);
void removeBreakpoint(int index, bool forProject);
PBreakpoint setBreakPointCondition(int index, const QString& condition, bool forProject);
const QList<PBreakpoint>& breakpoints(bool forProject) const {
return forProject?mProjectBreakpoints:mBreakpoints;
}
PBreakpoint breakpoint(int index, bool forProject) const;
public slots:
void updateBreakpointNumber(const QString& filename, int line, int number);
void invalidateAllBreakpointNumbers(); // call this when gdb is stopped
void onFileDeleteLines(const QString& filename, int startLine, int count);
void onFileInsertLines(const QString& filename, int startLine, int count);
void onFileDeleteLines(const QString& filename, int startLine, int count, bool forProject);
void onFileInsertLines(const QString& filename, int startLine, int count, bool forProject);
private:
QList<PBreakpoint> mList;
bool isForProject() const;
void setIsForProject(bool newIsForProject);
QList<PBreakpoint> loadJson(const QJsonArray& jsonArray, qint64 criteriaTime);
QJsonArray toJson(const QString& projectFolder);
void setBreakpoints(const QList<PBreakpoint>& list, bool forProject);
private:
QList<PBreakpoint> mBreakpoints;
QList<PBreakpoint> mProjectBreakpoints;
bool mIsForProject;
friend class Debugger;
};
class BacktraceModel : public QAbstractTableModel {
@ -164,11 +190,12 @@ public:
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
int columnCount(const QModelIndex &parent = QModelIndex()) const override;
bool hasChildren(const QModelIndex &parent) const override;
void addWatchVar(PWatchVar watchVar);
QModelIndex index(PWatchVar var) const;
QModelIndex index(WatchVar* pVar) const;
void removeWatchVar(const QString& expression);
void removeWatchVar(const QModelIndex& index);
void clear();
const QList<PWatchVar>& watchVars();
PWatchVar findWatchVar(const QModelIndex& index);
PWatchVar findWatchVar(const QString& expr);
void resetAllVarInfos();
@ -176,8 +203,6 @@ public:
void beginUpdate();
void endUpdate();
void notifyUpdated(PWatchVar var);
void save(const QString& filename);
void load(const QString& filename);
signals:
void setWatchVarValue(const QString& name, const QString& value);
public slots:
@ -200,17 +225,30 @@ public slots:
signals:
void fetchChildren(const QString& name);
private:
QModelIndex index(PWatchVar var) const;
QModelIndex index(WatchVar* pVar) const;
bool isForProject() const;
void setIsForProject(bool newIsForProject);
const QList<PWatchVar> &watchVars(bool forProject) const;
QJsonArray toJson(bool forProject);
QList<PWatchVar> loadJson(const QJsonArray &jsonArray, qint64 criteriaTimestamp);
const QList<PWatchVar> &watchVars() const;
void addWatchVar(PWatchVar watchVar);
void setWatchVars(const QList<PWatchVar> list, bool forProject);
private:
QList<PWatchVar> mWatchVars;
QHash<QString,PWatchVar> mVarIndex;
QList<PWatchVar> mProjectWatchVars;
QHash<QString,PWatchVar> mVarIndex; //var index is only valid for the current debugging session
int mUpdateCount;
bool mIsForProject;
// QAbstractItemModel interface
public:
bool setData(const QModelIndex &index, const QVariant &value, int role) override;
Qt::ItemFlags flags(const QModelIndex &index) const override;
friend class Debugger;
};
struct MemoryLine {
@ -267,20 +305,29 @@ public:
bool inferiorRunning();
void interrupt();
bool isForProject() const;
void setIsForProject(bool newIsForProject);
//breakpoints
void addBreakpoint(int line, const Editor* editor);
void addBreakpoint(int line, const QString& filename);
void deleteBreakpoints(const QString& filename);
void addBreakpoint(int line, const QString& filename, bool forProject);
void deleteBreakpoints(const QString& filename, bool forProject);
void deleteBreakpoints(const Editor* editor);
void deleteBreakpoints();
void deleteBreakpoints(bool forProject);
void removeBreakpoint(int line, const Editor* editor);
void removeBreakpoint(int line, const QString& filename);
void removeBreakpoint(int index);
PBreakpoint breakpointAt(int line, const QString& filename, int &index);
PBreakpoint breakpointAt(int line, const Editor* editor, int &index);
void setBreakPointCondition(int index, const QString& condition);
void removeBreakpoint(int line, const QString& filename, bool forProject);
void removeBreakpoint(int index, bool forProject);
PBreakpoint breakpointAt(int line, const QString &filename, int *index, bool forProject);
PBreakpoint breakpointAt(int line, const Editor *editor, int *index);
void setBreakPointCondition(int index, const QString& condition, bool forProject);
void sendAllBreakpointsToDebugger();
void saveForNonproject(const QString &filename);
void saveForProject(const QString &filename, const QString &projectFolder);
void loadForNonproject(const QString &filename);
void loadForProject(const QString& filename, const QString& projectFolder);
//watch vars
void addWatchVar(const QString& expression);
void modifyWatchVarExpression(const QString& oldExpr, const QString& newExpr);
@ -292,18 +339,18 @@ public:
PWatchVar watchVarAt(const QModelIndex& index);
// void notifyWatchVarUpdated(PWatchVar var);
BacktraceModel* backtraceModel();
BreakpointModel* breakpointModel();
std::shared_ptr<BacktraceModel> backtraceModel();
std::shared_ptr<BreakpointModel> breakpointModel();
bool executing() const;
int leftPageIndexBackup() const;
void setLeftPageIndexBackup(int leftPageIndexBackup);
WatchModel *watchModel() const;
std::shared_ptr<WatchModel> watchModel() const;
RegisterModel *registerModel() const;
std::shared_ptr<RegisterModel> registerModel() const;
MemoryModel *memoryModel() const;
std::shared_ptr<MemoryModel> memoryModel() const;
bool forceUTF8() const;
void setForceUTF8(bool newForceUTF8);
@ -320,8 +367,10 @@ private:
void sendWatchCommand(PWatchVar var);
void sendRemoveWatchCommand(PWatchVar var);
void sendBreakpointCommand(PBreakpoint breakpoint);
void sendClearBreakpointCommand(int index);
void sendClearBreakpointCommand(int index, bool forProject);
void sendClearBreakpointCommand(PBreakpoint breakpoint);
void save(const QString& filename, const QString& projectFolder);
PDebugConfig load(const QString& filename, bool forProject);
private slots:
void syncFinishedParsing();
@ -339,15 +388,17 @@ private slots:
private:
bool mExecuting;
bool mCommandChanged;
BreakpointModel *mBreakpointModel;
BacktraceModel *mBacktraceModel;
WatchModel *mWatchModel;
RegisterModel *mRegisterModel;
MemoryModel *mMemoryModel;
std::shared_ptr<BreakpointModel> mBreakpointModel;
std::shared_ptr<BacktraceModel> mBacktraceModel;
std::shared_ptr<WatchModel> mWatchModel;
std::shared_ptr<RegisterModel> mRegisterModel;
std::shared_ptr<MemoryModel> mMemoryModel;
DebugReader *mReader;
DebugTarget *mTarget;
bool mForceUTF8;
int mLeftPageIndexBackup;
qint64 mLastLoadtime;
qint64 mProjectLastLoadtime;
};
class DebugTarget: public QThread {

View File

@ -1291,7 +1291,7 @@ void Editor::showEvent(QShowEvent */*event*/)
resetCppParser(mParser);
reparse();
}
pMainWindow->debugger()->setIsForProject(inProject());
pMainWindow->bookmarkModel()->setIsForProject(inProject());
// if (pSettings->codeCompletion().clearWhenEditorHidden()
// && !inProject()) {
@ -1696,7 +1696,7 @@ void Editor::onTipEvalValueReady(const QString& value)
void Editor::onLinesDeleted(int first, int count)
{
pMainWindow->caretList().linesDeleted(this,first,count);
pMainWindow->debugger()->breakpointModel()->onFileDeleteLines(mFilename,first,count);
pMainWindow->debugger()->breakpointModel()->onFileDeleteLines(mFilename,first,count,inProject());
pMainWindow->bookmarkModel()->onFileDeleteLines(mFilename,first,count, inProject());
resetBreakpoints();
resetBookmarks();
@ -1708,7 +1708,7 @@ void Editor::onLinesDeleted(int first, int count)
void Editor::onLinesInserted(int first, int count)
{
pMainWindow->caretList().linesInserted(this,first,count);
pMainWindow->debugger()->breakpointModel()->onFileInsertLines(mFilename,first,count);
pMainWindow->debugger()->breakpointModel()->onFileInsertLines(mFilename,first,count, inProject());
pMainWindow->bookmarkModel()->onFileInsertLines(mFilename,first,count, inProject());
resetBreakpoints();
resetBookmarks();
@ -1756,7 +1756,7 @@ void Editor::resetBreakpoints()
{
mBreakpointLines.clear();
foreach (const PBreakpoint& breakpoint,
pMainWindow->debugger()->breakpointModel()->breakpoints()) {
pMainWindow->debugger()->breakpointModel()->breakpoints(inProject())) {
if (breakpoint->filename == mFilename) {
mBreakpointLines.insert(breakpoint->line);
}
@ -4444,7 +4444,7 @@ void Editor::removeBreakpointFocus()
void Editor::modifyBreakpointProperty(int line)
{
int index;
PBreakpoint breakpoint = pMainWindow->debugger()->breakpointAt(line,this,index);
PBreakpoint breakpoint = pMainWindow->debugger()->breakpointAt(line,this,&index);
if (!breakpoint)
return;
bool isOk;
@ -4454,7 +4454,7 @@ void Editor::modifyBreakpointProperty(int line)
QLineEdit::Normal,
breakpoint->condition,&isOk);
if (isOk) {
pMainWindow->debugger()->setBreakPointCondition(index,s);
pMainWindow->debugger()->setBreakPointCondition(index,s,inProject());
}
}

View File

@ -163,34 +163,26 @@ MainWindow::MainWindow(QWidget *parent)
mDebugger = std::make_shared<Debugger>();
m=ui->tblBreakpoints->selectionModel();
ui->tblBreakpoints->setModel(mDebugger->breakpointModel());
ui->tblBreakpoints->setModel(mDebugger->breakpointModel().get());
delete m;
m=ui->tblStackTrace->selectionModel();
ui->tblStackTrace->setModel(mDebugger->backtraceModel());
ui->tblStackTrace->setModel(mDebugger->backtraceModel().get());
delete m;
m=ui->watchView->selectionModel();
ui->watchView->setModel(mDebugger->watchModel());
ui->watchView->setModel(mDebugger->watchModel().get());
delete m;
m=ui->tblMemoryView->selectionModel();
ui->tblMemoryView->setModel(mDebugger->memoryModel());
ui->tblMemoryView->setModel(mDebugger->memoryModel().get());
delete m;
ui->tblMemoryView->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
try {
mDebugger->breakpointModel()->load(includeTrailingPathDelimiter(pSettings->dirs().config())
+DEV_BREAKPOINTS_FILE);
} catch (FileError &e) {
QMessageBox::warning(nullptr,
tr("Error"),
e.reason());
}
try {
mDebugger->watchModel()->load(includeTrailingPathDelimiter(pSettings->dirs().config())
+DEV_WATCH_FILE);
mDebugger->loadForNonproject(includeTrailingPathDelimiter(pSettings->dirs().config())
+DEV_DEBUGGER_FILE);
} catch (FileError &e) {
QMessageBox::warning(nullptr,
tr("Error"),
@ -1311,6 +1303,10 @@ void MainWindow::openProject(const QString &filename, bool openFiles)
mBookmarkModel->loadProjectBookmarks(
changeFileExt(mProject->filename(), PROJECT_BOOKMARKS_EXT),
mProject->directory());
mDebugger->setIsForProject(true);
mDebugger->loadForProject(
changeFileExt(mProject->filename(), PROJECT_DEBUG_EXT),
mProject->directory());
if (openFiles) {
PProjectUnit unit = mProject->doAutoOpen();
@ -4068,21 +4064,21 @@ void MainWindow::onBreakpointRemove()
{
int index =ui->tblBreakpoints->selectionModel()->currentIndex().row();
PBreakpoint breakpoint = debugger()->breakpointModel()->breakpoint(index);
PBreakpoint breakpoint = debugger()->breakpointModel()->breakpoint(index, debugger()->isForProject());
if (breakpoint) {
Editor * e = mEditorList->getOpenedEditorByFilename(breakpoint->filename);
if (e) {
if (e->hasBreakpoint(breakpoint->line))
e->toggleBreakpoint(breakpoint->line);
} else {
debugger()->breakpointModel()->removeBreakpoint(index);
debugger()->breakpointModel()->removeBreakpoint(index,debugger()->isForProject());
}
}
}
void MainWindow::onBreakpointViewRemoveAll()
{
pMainWindow->debugger()->deleteBreakpoints();
debugger()->deleteBreakpoints(debugger()->isForProject());
for (int i=0;i<mEditorList->pageCount();i++) {
Editor * e = (*(mEditorList))[i];
if (e) {
@ -4096,7 +4092,8 @@ void MainWindow::onBreakpointViewProperty()
int index =ui->tblBreakpoints->selectionModel()->currentIndex().row();
PBreakpoint breakpoint = debugger()->breakpointModel()->breakpoint(
index
index,
debugger()->isForProject()
);
if (breakpoint) {
bool isOk;
@ -4106,7 +4103,7 @@ void MainWindow::onBreakpointViewProperty()
QLineEdit::Normal,
breakpoint->condition,&isOk);
if (isOk) {
pMainWindow->debugger()->setBreakPointCondition(index,s);
pMainWindow->debugger()->setBreakPointCondition(index,s,debugger()->isForProject());
}
}
}
@ -4373,6 +4370,10 @@ void MainWindow::closeProject(bool refreshEditor)
changeFileExt(mProject->filename(), PROJECT_BOOKMARKS_EXT),
mProject->directory());
mDebugger->saveForProject(
changeFileExt(mProject->filename(), PROJECT_DEBUG_EXT),
mProject->directory());
mClassBrowserModel.beginUpdate();
// Remember it
pSettings->history().addToOpenedProjects(mProject->filename());
@ -4394,6 +4395,7 @@ void MainWindow::closeProject(bool refreshEditor)
if (!mQuitting) {
mBookmarkModel->setIsForProject(false);
mDebugger->setIsForProject(false);
// Clear error browser
clearIssues();
updateProjectView();
@ -4610,10 +4612,10 @@ void MainWindow::closeEvent(QCloseEvent *event) {
e.reason());
}
if (pSettings->debugger().autosaveBreakpoints()) {
if (pSettings->debugger().autosave()) {
try {
mDebugger->breakpointModel()->save(includeTrailingPathDelimiter(pSettings->dirs().config())
+DEV_BREAKPOINTS_FILE);
mDebugger->saveForNonproject(includeTrailingPathDelimiter(pSettings->dirs().config())
+DEV_DEBUGGER_FILE);
} catch (FileError& e) {
QMessageBox::warning(nullptr,
tr("Save Error"),
@ -4621,20 +4623,7 @@ void MainWindow::closeEvent(QCloseEvent *event) {
}
} else
removeFile(includeTrailingPathDelimiter(pSettings->dirs().config())
+DEV_BREAKPOINTS_FILE);
if (pSettings->debugger().autosaveWatches()) {
try {
mDebugger->watchModel()->save(includeTrailingPathDelimiter(pSettings->dirs().config())
+DEV_WATCH_FILE);
} catch (FileError& e) {
QMessageBox::warning(nullptr,
tr("Save Error"),
e.reason());
}
} else
removeFile(includeTrailingPathDelimiter(pSettings->dirs().config())
+DEV_WATCH_FILE);
+DEV_DEBUGGER_FILE);
}
if (!mShouldRemoveAllSettings && pSettings->editor().autoLoadLastFiles()) {
@ -5289,20 +5278,21 @@ bool MainWindow::debugInferiorhasBreakpoint()
Editor * e = mEditorList->getEditor();
if (e==nullptr)
return false;
if (!e->inProject()) {
for (const PBreakpoint& breakpoint:mDebugger->breakpointModel()->breakpoints()) {
if (e->filename() == breakpoint->filename) {
return true;
}
}
} else {
for (const PBreakpoint& breakpoint:mDebugger->breakpointModel()->breakpoints()) {
Editor* e1 = mEditorList->getOpenedEditorByFilename(breakpoint->filename);
if (e1 && e1->inProject()) {
return true;
}
for (const PBreakpoint& breakpoint:mDebugger->breakpointModel()->breakpoints(e->inProject())) {
if (e->filename() == breakpoint->filename) {
return true;
}
}
// if (!e->inProject()) {
// } else {
// for (const PBreakpoint& breakpoint:mDebugger->breakpointModel()->breakpoints(e->inProject())) {
// Editor* e1 = mEditorList->getOpenedEditorByFilename(breakpoint->filename);
// if (e1 && e1->inProject()) {
// return true;
// }
// }
// }
return false;
}
@ -5875,7 +5865,9 @@ void MainWindow::on_tblStackTrace_doubleClicked(const QModelIndex &index)
void MainWindow::on_tblBreakpoints_doubleClicked(const QModelIndex &index)
{
PBreakpoint breakpoint = mDebugger->breakpointModel()->breakpoint(index.row());
PBreakpoint breakpoint = mDebugger->breakpointModel()->breakpoint(
index.row(),
mDebugger->isForProject());
if (breakpoint) {
Editor * e = mEditorList->getEditorByFilename(breakpoint->filename);
if (e) {

View File

@ -3532,16 +3532,6 @@ void Settings::Debugger::setSkipCustomLibraries(bool newSkipCustomLibraries)
mSkipCustomLibraries = newSkipCustomLibraries;
}
bool Settings::Debugger::autosaveWatches() const
{
return mAutosaveWatches;
}
void Settings::Debugger::setAutosaveWatches(bool newAutosaveWatches)
{
mAutosaveWatches = newAutosaveWatches;
}
bool Settings::Debugger::openCPUInfoWhenSignaled() const
{
return mOpenCPUInfoWhenSignaled;
@ -3592,14 +3582,14 @@ void Settings::Debugger::setMemoryViewColumns(int newMemoryViewColumns)
mMemoryViewColumns = newMemoryViewColumns;
}
bool Settings::Debugger::autosaveBreakpoints() const
bool Settings::Debugger::autosave() const
{
return mAutosaveBreakpoints;
return mAutosave;
}
void Settings::Debugger::setAutosaveBreakpoints(bool newAutosaveBreakpoints)
void Settings::Debugger::setAutosave(bool newAutosave)
{
mAutosaveBreakpoints = newAutosaveBreakpoints;
mAutosave = newAutosave;
}
bool Settings::Debugger::useIntelStyle() const
@ -3644,8 +3634,7 @@ void Settings::Debugger::doSave()
saveValue("skip_system_lib", mSkipSystemLibraries);
saveValue("skip_project_lib", mSkipProjectLibraries);
saveValue("skip_custom_lib", mSkipCustomLibraries);
saveValue("autosave_breakpoints",mAutosaveBreakpoints);
saveValue("autosave_watches",mAutosaveWatches);
saveValue("autosave",mAutosave);
saveValue("open_cpu_info_when_signaled",mOpenCPUInfoWhenSignaled);
saveValue("use_gdb_server", mUseGDBServer);
saveValue("gdb_server_port",mGDBServerPort);
@ -3670,8 +3659,7 @@ void Settings::Debugger::doLoad()
mSkipSystemLibraries = boolValue("skip_system_lib",true);
mSkipProjectLibraries = boolValue("skip_project_lib",true);
mSkipCustomLibraries = boolValue("skip_custom_lib",false);
mAutosaveBreakpoints = boolValue("autosave_breakpoints",true);
mAutosaveWatches = boolValue("autosave_watches",true);
mAutosave = boolValue("autosave",true);
mOpenCPUInfoWhenSignaled = boolValue("open_cpu_info_when_signaled",true);
#ifdef Q_OS_WIN
mUseGDBServer = boolValue("use_gdb_server", false);

View File

@ -1126,12 +1126,6 @@ public:
bool skipCustomLibraries() const;
void setSkipCustomLibraries(bool newSkipCustomLibraries);
bool autosaveBreakpoints() const;
void setAutosaveBreakpoints(bool newAutosaveBreakpoints);
bool autosaveWatches() const;
void setAutosaveWatches(bool newAutosaveWatches);
bool openCPUInfoWhenSignaled() const;
void setOpenCPUInfoWhenSignaled(bool newOpenCPUInfoWhenSignaled);
@ -1146,6 +1140,9 @@ public:
int memoryViewColumns() const;
void setMemoryViewColumns(int newMemoryViewColumns);
bool autosave() const;
void setAutosave(bool newAutosave);
private:
bool mEnableDebugConsole;
bool mShowDetailLog;
@ -1157,8 +1154,7 @@ public:
bool mSkipSystemLibraries;
bool mSkipProjectLibraries;
bool mSkipCustomLibraries;
bool mAutosaveBreakpoints;
bool mAutosaveWatches;
bool mAutosave;
bool mOpenCPUInfoWhenSignaled;
bool mUseGDBServer;
int mGDBServerPort;

View File

@ -48,8 +48,7 @@ void DebugGeneralWidget::doLoad()
ui->chkSkipSystemLib->setChecked(pSettings->debugger().skipSystemLibraries());
ui->chkSkipProjectLib->setChecked(pSettings->debugger().skipProjectLibraries());
ui->chkSkipCustomLib->setChecked(pSettings->debugger().skipCustomLibraries());
ui->chkAutosaveBreakpoints->setChecked(pSettings->debugger().autosaveBreakpoints());
ui->chkAutosaveWatches->setChecked(pSettings->debugger().autosaveWatches());
ui->chkAutosave->setChecked(pSettings->debugger().autosave());
#ifdef Q_OS_WIN
ui->grpUseGDBServer->setCheckable(true);
ui->grpUseGDBServer->setChecked(pSettings->debugger().useGDBServer());
@ -72,8 +71,7 @@ void DebugGeneralWidget::doSave()
pSettings->debugger().setSkipSystemLibraries(ui->chkSkipSystemLib->isChecked());
pSettings->debugger().setSkipProjectLibraries(ui->chkSkipProjectLib->isChecked());
pSettings->debugger().setSkipCustomLibraries(ui->chkSkipCustomLib->isChecked());
pSettings->debugger().setAutosaveBreakpoints(ui->chkAutosaveBreakpoints->isChecked());
pSettings->debugger().setAutosaveWatches(ui->chkAutosaveWatches->isChecked());
pSettings->debugger().setAutosave(ui->chkAutosave->isChecked());
#ifdef Q_OS_WIN
pSettings->debugger().setUseGDBServer(ui->grpUseGDBServer->isChecked());
#endif

View File

@ -318,16 +318,9 @@
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QCheckBox" name="chkAutosaveBreakpoints">
<widget class="QCheckBox" name="chkAutosave">
<property name="text">
<string>Autosave breakpoints</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="chkAutosaveWatches">
<property name="text">
<string>Autosave watches</string>
<string>Autosave breakpoints and watches</string>
</property>
</widget>
</item>

View File

@ -71,6 +71,7 @@
#define DEV_PROJECT_EXT "dev"
#define PROJECT_BOOKMARKS_EXT "bookmarks"
#define PROJECT_DEBUG_EXT "debug"
#define RC_EXT "rc"
#define RES_EXT "res"
#define H_EXT "h"
@ -89,8 +90,7 @@
#define DEV_SHORTCUT_FILE "shortcuts.json"
#define DEV_TOOLS_FILE "tools.json"
#define DEV_BOOKMARK_FILE "bookmarks.json"
#define DEV_BREAKPOINTS_FILE "breakpoints.json"
#define DEV_WATCH_FILE "watch.json"
#define DEV_DEBUGGER_FILE "debugger.json"
#ifdef Q_OS_WIN
# define PATH_SENSITIVITY Qt::CaseInsensitive

View File

@ -182,7 +182,9 @@ void BookmarkModel::loadBookmarks(const QString &filename)
{
if (!mIsForProject)
beginResetModel();
mBookmarks = load(filename,0,&mLastLoadBookmarksTimestamp);
qint64 t;
mLastLoadBookmarksTimestamp = QDateTime::currentMSecsSinceEpoch();
mBookmarks = load(filename,0,&t);
if (!mIsForProject)
endResetModel();
}
@ -227,7 +229,6 @@ void BookmarkModel::save(const QString &filename, const QString& projectFolder)
if (pTemp->timestamp<=bookmark->timestamp)
compareHash.insert(key,bookmark);
}
compareHash.insert(key,bookmark);
}
QList<PBookmark> saveList;
foreach (const PBookmark& bookmark, compareHash) {
@ -320,7 +321,9 @@ void BookmarkModel::loadProjectBookmarks(const QString &filename, const QString&
{
if (mIsForProject)
beginResetModel();
mProjectBookmarks = load(filename,0,&mLastLoadProjectBookmarksTimestamp);
qint64 t;
mLastLoadProjectBookmarksTimestamp = QDateTime::currentMSecsSinceEpoch();
mProjectBookmarks = load(filename,0,&t);
QDir folder(projectFolder);
foreach (PBookmark bookmark, mProjectBookmarks) {
bookmark->filename=folder.absoluteFilePath(bookmark->filename);

View File

@ -56,7 +56,7 @@ CPUDialog::CPUDialog(QWidget *parent) :
}
resetEditorFont(screenDPI());
QItemSelectionModel *m=ui->lstRegister->selectionModel();
ui->lstRegister->setModel(pMainWindow->debugger()->registerModel());
ui->lstRegister->setModel(pMainWindow->debugger()->registerModel().get());
delete m;
ui->rdIntel->setChecked(pSettings->debugger().useIntelStyle());