From b5706d77cf1ac184ca56ec304b0081d3c1c42fd3 Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 28 Sep 2009 13:35:39 +0200 Subject: debugger: save a few cycles when writing to the gdb process --- src/plugins/debugger/gdb/abstractgdbadapter.h | 2 +- src/plugins/debugger/gdb/attachgdbadapter.h | 2 +- src/plugins/debugger/gdb/coregdbadapter.h | 2 +- src/plugins/debugger/gdb/plaingdbadapter.h | 2 +- src/plugins/debugger/gdb/remotegdbadapter.h | 2 +- src/plugins/debugger/gdb/trkgdbadapter.cpp | 4 ++-- src/plugins/debugger/gdb/trkgdbadapter.h | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/debugger/gdb/abstractgdbadapter.h b/src/plugins/debugger/gdb/abstractgdbadapter.h index 1e30c87b44..943842fc44 100644 --- a/src/plugins/debugger/gdb/abstractgdbadapter.h +++ b/src/plugins/debugger/gdb/abstractgdbadapter.h @@ -54,7 +54,7 @@ public: virtual QByteArray readAllStandardError() = 0; virtual QByteArray readAllStandardOutput() = 0; - virtual qint64 write(const char *data) = 0; + virtual void write(const QByteArray &data) = 0; virtual void setWorkingDirectory(const QString &dir) = 0; virtual void setEnvironment(const QStringList &env) = 0; virtual bool isTrkAdapter() const = 0; diff --git a/src/plugins/debugger/gdb/attachgdbadapter.h b/src/plugins/debugger/gdb/attachgdbadapter.h index 6cccac5529..7f9d8d46cc 100644 --- a/src/plugins/debugger/gdb/attachgdbadapter.h +++ b/src/plugins/debugger/gdb/attachgdbadapter.h @@ -55,7 +55,7 @@ public: private: QByteArray readAllStandardError() { return m_gdbProc.readAllStandardError(); } QByteArray readAllStandardOutput() { return m_gdbProc.readAllStandardOutput(); } - qint64 write(const char *data) { return m_gdbProc.write(data); } + void write(const QByteArray &data) { m_gdbProc.write(data, data.size()); } void setWorkingDirectory(const QString &dir) { m_gdbProc.setWorkingDirectory(dir); } void setEnvironment(const QStringList &env) { m_gdbProc.setEnvironment(env); } bool isTrkAdapter() const { return false; } diff --git a/src/plugins/debugger/gdb/coregdbadapter.h b/src/plugins/debugger/gdb/coregdbadapter.h index b448fa2a93..c432b62275 100644 --- a/src/plugins/debugger/gdb/coregdbadapter.h +++ b/src/plugins/debugger/gdb/coregdbadapter.h @@ -55,7 +55,7 @@ public: private: QByteArray readAllStandardError() { return m_gdbProc.readAllStandardError(); } QByteArray readAllStandardOutput() { return m_gdbProc.readAllStandardOutput(); } - qint64 write(const char *data) { return m_gdbProc.write(data); } + void write(const QByteArray &data) { m_gdbProc.write(data, data.size()); } void setWorkingDirectory(const QString &dir) { m_gdbProc.setWorkingDirectory(dir); } void setEnvironment(const QStringList &env) { m_gdbProc.setEnvironment(env); } bool isTrkAdapter() const { return false; } diff --git a/src/plugins/debugger/gdb/plaingdbadapter.h b/src/plugins/debugger/gdb/plaingdbadapter.h index 1a8b7f55b2..aade811839 100644 --- a/src/plugins/debugger/gdb/plaingdbadapter.h +++ b/src/plugins/debugger/gdb/plaingdbadapter.h @@ -56,7 +56,7 @@ public: QByteArray readAllStandardError() { return m_gdbProc.readAllStandardError(); } QByteArray readAllStandardOutput() { return m_gdbProc.readAllStandardOutput(); } - qint64 write(const char *data) { return m_gdbProc.write(data); } + void write(const QByteArray &data) { m_gdbProc.write(data, data.size()); } void setWorkingDirectory(const QString &dir) { m_gdbProc.setWorkingDirectory(dir); } void setEnvironment(const QStringList &env) { m_gdbProc.setEnvironment(env); } bool isTrkAdapter() const { return false; } diff --git a/src/plugins/debugger/gdb/remotegdbadapter.h b/src/plugins/debugger/gdb/remotegdbadapter.h index 263b32d2ab..15ef70c6f7 100644 --- a/src/plugins/debugger/gdb/remotegdbadapter.h +++ b/src/plugins/debugger/gdb/remotegdbadapter.h @@ -55,7 +55,7 @@ public: private: QByteArray readAllStandardError() { return m_gdbProc.readAllStandardError(); } QByteArray readAllStandardOutput() { return m_gdbProc.readAllStandardOutput(); } - qint64 write(const char *data) { return m_gdbProc.write(data); } + void write(const QByteArray &data) { m_gdbProc.write(data, data.size()); } void setWorkingDirectory(const QString &dir) { m_gdbProc.setWorkingDirectory(dir); } void setEnvironment(const QStringList &env) { m_gdbProc.setEnvironment(env); } bool isTrkAdapter() const { return false; } diff --git a/src/plugins/debugger/gdb/trkgdbadapter.cpp b/src/plugins/debugger/gdb/trkgdbadapter.cpp index 3105d1fc70..3853978c1d 100644 --- a/src/plugins/debugger/gdb/trkgdbadapter.cpp +++ b/src/plugins/debugger/gdb/trkgdbadapter.cpp @@ -1623,9 +1623,9 @@ QByteArray TrkGdbAdapter::readAllStandardOutput() return m_gdbProc.readAllStandardOutput(); } -qint64 TrkGdbAdapter::write(const char *data) +void TrkGdbAdapter::write(const QByteArray &data) { - return m_gdbProc.write(data); + m_gdbProc.write(data, data.size()); } void TrkGdbAdapter::setWorkingDirectory(const QString &dir) diff --git a/src/plugins/debugger/gdb/trkgdbadapter.h b/src/plugins/debugger/gdb/trkgdbadapter.h index 38ec1d35af..5b3ea34f8d 100644 --- a/src/plugins/debugger/gdb/trkgdbadapter.h +++ b/src/plugins/debugger/gdb/trkgdbadapter.h @@ -109,7 +109,7 @@ public: QIODevice::OpenMode mode = QIODevice::ReadWrite); QByteArray readAllStandardError(); QByteArray readAllStandardOutput(); - qint64 write(const char *data); + void write(const QByteArray &data); void setWorkingDirectory(const QString &dir); void setEnvironment(const QStringList &env); bool isTrkAdapter() const { return true; } -- cgit v1.2.1