Commit 01006580 authored by hjk's avatar hjk

Debugger: Go back to QVector in GdbMi

We are overstretching std::vector implementations in some
cases of partial self-assignment.

Task-number: QTCREATORBUG-15183
Change-Id: I144e9e34df117286a7eef6403e29054d530cacbe
Reviewed-by: default avatarChristian Stenger <christian.stenger@theqtcompany.com>
parent a065f456
......@@ -36,9 +36,9 @@
#include <QString>
#include <QJsonValue>
#include <QJsonObject>
#include <QVector>
#include <functional>
#include <vector>
namespace Debugger {
namespace Internal {
......@@ -136,7 +136,7 @@ public:
QByteArray m_name;
QByteArray m_data;
std::vector<GdbMi> m_children;
QVector<GdbMi> m_children;
enum Type { Invalid, Const, Tuple, List };
......@@ -150,7 +150,7 @@ public:
bool isList() const { return m_type == List; }
const QByteArray &data() const { return m_data; }
const std::vector<GdbMi> &children() const { return m_children; }
const QVector<GdbMi> &children() const { return m_children; }
int childCount() const { return int(m_children.size()); }
const GdbMi &childAt(int index) const { return m_children[index]; }
......
......@@ -3341,8 +3341,8 @@ void GdbEngine::handleThreadListIds(const DebuggerResponse &response)
// "72^done,{thread-ids={thread-id="2",thread-id="1"},number-of-threads="2"}
// In gdb 7.1+ additionally: current-thread-id="1"
ThreadsHandler *handler = threadsHandler();
const std::vector<GdbMi> &items = response.data["thread-ids"].children();
for (size_t index = 0, n = items.size(); index != n; ++index) {
const QVector<GdbMi> &items = response.data["thread-ids"].children();
for (int index = 0, n = items.size(); index != n; ++index) {
ThreadData thread;
thread.id = ThreadId(items.at(index).toInt());
handler->updateThread(thread);
......
......@@ -445,7 +445,7 @@ void ThreadsHandler::updateThreads(const GdbMi &data)
// file="/.../app.cpp",fullname="/../app.cpp",line="1175"},
// state="stopped",core="0"}],current-thread-id="1"
const std::vector<GdbMi> items = data["threads"].children();
const QVector<GdbMi> items = data["threads"].children();
const int n = int(items.size());
for (int index = 0; index != n; ++index) {
const GdbMi item = items[index];
......
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