- fix: can't correctly display stl containers in watch

This commit is contained in:
Roy Qu 2021-11-25 21:44:08 +08:00
parent 817b1ca11f
commit cbec8f60f4
4 changed files with 17 additions and 6 deletions

View File

@ -1,3 +1,7 @@
Version 0.10.1 For Dev-C++ 7 Beta
- fix: can't correctly expand watch expression that has spaces in it
- fix: can't correctly display stl containers in watch
Version 0.10.0 For Dev-C++ 7 Beta Version 0.10.0 For Dev-C++ 7 Beta
- enhancement: use gdb/mi interface to communicate with gdb debug session - enhancement: use gdb/mi interface to communicate with gdb debug session
- enhancement: better display of watch vars - enhancement: better display of watch vars

View File

@ -913,7 +913,7 @@ void DebugReader::runNextCmd()
params = " - @ "+params; params = " - @ "+params;
} else if (pCmd->command == "-var-list-children") { } else if (pCmd->command == "-var-list-children") {
//hack for list variable children,to easy remember var expression //hack for list variable children,to easy remember var expression
params = " --all-values " + params; params = " --all-values \"" + params+'\"';
} }
s+=" "+params; s+=" "+params;
s+= "\n"; s+= "\n";
@ -1853,6 +1853,11 @@ void WatchModel::prepareVarChildren(const QString &parentName, int numChild, boo
if (var) { if (var) {
var->numChild = numChild; var->numChild = numChild;
var->hasMore = hasMore; var->hasMore = hasMore;
if (var->children.count()>0) {
beginRemoveRows(index(var),0,var->children.count()-1);
var->children.clear();
endRemoveRows();
}
} }
} }
@ -1891,14 +1896,15 @@ void WatchModel::updateVarValue(const QString &name, const QString &val, const Q
var->type = newType; var->type = newType;
} }
QModelIndex idx = index(var); QModelIndex idx = index(var);
bool oldHasMore = var->hasMore;
var->hasMore = hasMore;
if (newNumChildren>=0 if (newNumChildren>=0
&& var->numChild!=newNumChildren) { && var->numChild!=newNumChildren) {
beginRemoveRows(idx,0,var->children.count());
var->children.clear();
endRemoveRows();
var->numChild = newNumChildren; var->numChild = newNumChildren;
fetchMore(idx);
} else if (!oldHasMore && hasMore) {
fetchMore(idx);
} }
var->hasMore = hasMore;
emit dataChanged(idx,createIndex(idx.row(),2,var.get())); emit dataChanged(idx,createIndex(idx.row(),2,var.get()));
} }

View File

@ -1447,6 +1447,7 @@ void MainWindow::debug()
mDebugger->sendAllBreakpointsToDebugger(); mDebugger->sendAllBreakpointsToDebugger();
// Run the debugger // Run the debugger
mDebugger->sendCommand("-enable-pretty-printing","");
mDebugger->sendCommand("-data-list-register-names",""); mDebugger->sendCommand("-data-list-register-names","");
mDebugger->sendCommand("-gdb-set", "width 0"); // don't wrap output, very annoying mDebugger->sendCommand("-gdb-set", "width 0"); // don't wrap output, very annoying
mDebugger->sendCommand("-gdb-set", "new-console on"); mDebugger->sendCommand("-gdb-set", "new-console on");

View File

@ -2,6 +2,6 @@
#define VERSION_H #define VERSION_H
#include <QObject> #include <QObject>
#define DEVCPP_VERSION "beta.0.10.0" #define DEVCPP_VERSION "beta.0.10.1"
#endif // VERSION_H #endif // VERSION_H