From cbec8f60f4ef0e3fda427e895e1e6a0e48b55db6 Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Thu, 25 Nov 2021 21:44:08 +0800 Subject: [PATCH] - fix: can't correctly display stl containers in watch --- NEWS.md | 4 ++++ RedPandaIDE/debugger.cpp | 16 +++++++++++----- RedPandaIDE/mainwindow.cpp | 1 + RedPandaIDE/version.h | 2 +- 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/NEWS.md b/NEWS.md index 94148481..a215f6d8 100644 --- a/NEWS.md +++ b/NEWS.md @@ -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 - enhancement: use gdb/mi interface to communicate with gdb debug session - enhancement: better display of watch vars diff --git a/RedPandaIDE/debugger.cpp b/RedPandaIDE/debugger.cpp index 06f6ae10..d8f51560 100644 --- a/RedPandaIDE/debugger.cpp +++ b/RedPandaIDE/debugger.cpp @@ -913,7 +913,7 @@ void DebugReader::runNextCmd() params = " - @ "+params; } else if (pCmd->command == "-var-list-children") { //hack for list variable children,to easy remember var expression - params = " --all-values " + params; + params = " --all-values \"" + params+'\"'; } s+=" "+params; s+= "\n"; @@ -1853,6 +1853,11 @@ void WatchModel::prepareVarChildren(const QString &parentName, int numChild, boo if (var) { var->numChild = numChild; 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; } QModelIndex idx = index(var); + bool oldHasMore = var->hasMore; + var->hasMore = hasMore; if (newNumChildren>=0 && var->numChild!=newNumChildren) { - beginRemoveRows(idx,0,var->children.count()); - var->children.clear(); - endRemoveRows(); var->numChild = newNumChildren; + fetchMore(idx); + } else if (!oldHasMore && hasMore) { + fetchMore(idx); } - var->hasMore = hasMore; emit dataChanged(idx,createIndex(idx.row(),2,var.get())); } diff --git a/RedPandaIDE/mainwindow.cpp b/RedPandaIDE/mainwindow.cpp index fb3c2d1b..82183287 100644 --- a/RedPandaIDE/mainwindow.cpp +++ b/RedPandaIDE/mainwindow.cpp @@ -1447,6 +1447,7 @@ void MainWindow::debug() mDebugger->sendAllBreakpointsToDebugger(); // Run the debugger + mDebugger->sendCommand("-enable-pretty-printing",""); mDebugger->sendCommand("-data-list-register-names",""); mDebugger->sendCommand("-gdb-set", "width 0"); // don't wrap output, very annoying mDebugger->sendCommand("-gdb-set", "new-console on"); diff --git a/RedPandaIDE/version.h b/RedPandaIDE/version.h index e8f5a828..5285c2e7 100644 --- a/RedPandaIDE/version.h +++ b/RedPandaIDE/version.h @@ -2,6 +2,6 @@ #define VERSION_H #include -#define DEVCPP_VERSION "beta.0.10.0" +#define DEVCPP_VERSION "beta.0.10.1" #endif // VERSION_H