summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhjk <hjk@theqtcompany.com>2015-10-15 17:57:39 +0200
committerhjk <hjk@theqtcompany.com>2015-10-16 05:59:04 +0000
commit01006580c10a4b9f8be689af61e90cd0f9134688 (patch)
treebfa6a1eddbc5e7250948c41a855fd8725b52addb
parenta065f45664078efa082cfbeb4140770e6d5dd351 (diff)
downloadqt-creator-01006580c10a4b9f8be689af61e90cd0f9134688.tar.gz
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>
-rw-r--r--src/plugins/debugger/debuggerprotocol.h6
-rw-r--r--src/plugins/debugger/gdb/gdbengine.cpp4
-rw-r--r--src/plugins/debugger/threadshandler.cpp2
3 files changed, 6 insertions, 6 deletions
diff --git a/src/plugins/debugger/debuggerprotocol.h b/src/plugins/debugger/debuggerprotocol.h
index a8006172ae..02dabc5707 100644
--- a/src/plugins/debugger/debuggerprotocol.h
+++ b/src/plugins/debugger/debuggerprotocol.h
@@ -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]; }
diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp
index 75a36fdfbe..670ba83a99 100644
--- a/src/plugins/debugger/gdb/gdbengine.cpp
+++ b/src/plugins/debugger/gdb/gdbengine.cpp
@@ -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);
diff --git a/src/plugins/debugger/threadshandler.cpp b/src/plugins/debugger/threadshandler.cpp
index ed41f3420a..2ba066ec2c 100644
--- a/src/plugins/debugger/threadshandler.cpp
+++ b/src/plugins/debugger/threadshandler.cpp
@@ -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];