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: Christian Stenger <christian.stenger@theqtcompany.com>
This commit is contained in:
hjk
2015-10-15 17:57:39 +02:00
parent a065f45664
commit 01006580c1
3 changed files with 6 additions and 6 deletions

View File

@@ -36,9 +36,9 @@
#include <QString> #include <QString>
#include <QJsonValue> #include <QJsonValue>
#include <QJsonObject> #include <QJsonObject>
#include <QVector>
#include <functional> #include <functional>
#include <vector>
namespace Debugger { namespace Debugger {
namespace Internal { namespace Internal {
@@ -136,7 +136,7 @@ public:
QByteArray m_name; QByteArray m_name;
QByteArray m_data; QByteArray m_data;
std::vector<GdbMi> m_children; QVector<GdbMi> m_children;
enum Type { Invalid, Const, Tuple, List }; enum Type { Invalid, Const, Tuple, List };
@@ -150,7 +150,7 @@ public:
bool isList() const { return m_type == List; } bool isList() const { return m_type == List; }
const QByteArray &data() const { return m_data; } 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()); } int childCount() const { return int(m_children.size()); }
const GdbMi &childAt(int index) const { return m_children[index]; } const GdbMi &childAt(int index) const { return m_children[index]; }

View File

@@ -3341,8 +3341,8 @@ void GdbEngine::handleThreadListIds(const DebuggerResponse &response)
// "72^done,{thread-ids={thread-id="2",thread-id="1"},number-of-threads="2"} // "72^done,{thread-ids={thread-id="2",thread-id="1"},number-of-threads="2"}
// In gdb 7.1+ additionally: current-thread-id="1" // In gdb 7.1+ additionally: current-thread-id="1"
ThreadsHandler *handler = threadsHandler(); ThreadsHandler *handler = threadsHandler();
const std::vector<GdbMi> &items = response.data["thread-ids"].children(); const QVector<GdbMi> &items = response.data["thread-ids"].children();
for (size_t index = 0, n = items.size(); index != n; ++index) { for (int index = 0, n = items.size(); index != n; ++index) {
ThreadData thread; ThreadData thread;
thread.id = ThreadId(items.at(index).toInt()); thread.id = ThreadId(items.at(index).toInt());
handler->updateThread(thread); handler->updateThread(thread);

View File

@@ -445,7 +445,7 @@ void ThreadsHandler::updateThreads(const GdbMi &data)
// file="/.../app.cpp",fullname="/../app.cpp",line="1175"}, // file="/.../app.cpp",fullname="/../app.cpp",line="1175"},
// state="stopped",core="0"}],current-thread-id="1" // 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()); const int n = int(items.size());
for (int index = 0; index != n; ++index) { for (int index = 0; index != n; ++index) {
const GdbMi item = items[index]; const GdbMi item = items[index];