Commit a6dd51c7 authored by hjk's avatar hjk
Browse files

debugger: properly sort arrays even with the 'classic' gdb engine

parent 6e824883
......@@ -761,7 +761,7 @@ void GdbEngine::handleDebuggingHelperVersionCheckClassic(const GdbResponse &resp
}
void GdbEngine::handleVarListChildrenHelperClassic(const GdbMi &item,
const WatchData &parent)
const WatchData &parent, int sortId)
{
//qDebug() << "VAR_LIST_CHILDREN: PARENT" << parent.toString();
//qDebug() << "VAR_LIST_CHILDREN: ITEM" << item.toString();
......@@ -812,6 +812,7 @@ void GdbEngine::handleVarListChildrenHelperClassic(const GdbMi &item,
WatchData data;
data.iname = parent.iname + '.' + exp;
data.variable = name;
data.sortId = sortId;
setWatchDataType(data, item.findChild("type"));
setWatchDataValue(data, item);
setWatchDataAddress(data, item.findChild("addr"));
......@@ -870,12 +871,12 @@ void GdbEngine::handleVarListChildrenClassic(const GdbResponse &response)
return;
if (response.resultClass == GdbResultDone) {
//qDebug() << "VAR_LIST_CHILDREN: PARENT" << data.toString();
GdbMi children = response.data.findChild("children");
QList<GdbMi> children = response.data.findChild("children").children();
foreach (const GdbMi &child, children.children())
handleVarListChildrenHelperClassic(child, data);
for (int i = 0; i != children.size(); ++i)
handleVarListChildrenHelperClassic(children.at(i), data, i);
if (children.children().isEmpty()) {
if (children.isEmpty()) {
// happens e.g. if no debug information is present or
// if the class really has no children
WatchData data1;
......
......@@ -490,7 +490,7 @@ private: ////////// View & Data Stuff //////////
void handleVarListChildrenClassic(const GdbResponse &response);
void handleVarListChildrenHelperClassic(const GdbMi &child,
const WatchData &parent);
const WatchData &parent, int sortId);
void handleVarCreate(const GdbResponse &response);
void handleVarAssign(const GdbResponse &response);
void handleEvaluateExpressionClassic(const GdbResponse &response);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment