forked from qt-creator/qt-creator
Debugger: Use internal decoding of Process for gdbserver
Change-Id: I174df8ef1c1a93aa25a8863030855552faea7bda Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
@@ -54,7 +54,6 @@
|
|||||||
#include <qtsupport/qtkitaspect.h>
|
#include <qtsupport/qtkitaspect.h>
|
||||||
|
|
||||||
#include <QTcpServer>
|
#include <QTcpServer>
|
||||||
#include <QTextCodec>
|
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
|
|
||||||
using namespace Core;
|
using namespace Core;
|
||||||
@@ -105,9 +104,6 @@ public:
|
|||||||
|
|
||||||
// DebugServer
|
// DebugServer
|
||||||
Process debuggerServerProc;
|
Process debuggerServerProc;
|
||||||
QTextCodec *debuggerServerCodec = QTextCodec::codecForName("utf8");
|
|
||||||
QTextCodec::ConverterState outputCodecState; // FIXME: Handle on Process side.
|
|
||||||
QTextCodec::ConverterState errorCodecState;
|
|
||||||
ProcessHandle serverAttachPid;
|
ProcessHandle serverAttachPid;
|
||||||
bool serverUseMulti = true;
|
bool serverUseMulti = true;
|
||||||
bool serverEssential = true;
|
bool serverEssential = true;
|
||||||
@@ -875,6 +871,8 @@ DebuggerRunTool::DebuggerRunTool(RunControl *runControl, AllowTerminal allowTerm
|
|||||||
if (EngineManager::engines().isEmpty())
|
if (EngineManager::engines().isEmpty())
|
||||||
toolRunCount = 0;
|
toolRunCount = 0;
|
||||||
|
|
||||||
|
d->debuggerServerProc.setUtf8Codec();
|
||||||
|
|
||||||
d->runId = QString::number(++toolRunCount);
|
d->runId = QString::number(++toolRunCount);
|
||||||
d->allowTerminal = allowTerminal;
|
d->allowTerminal = allowTerminal;
|
||||||
|
|
||||||
@@ -1155,17 +1153,13 @@ void DebuggerRunTool::startDebugServerIfNeededAndContinueStartup()
|
|||||||
|
|
||||||
connect(&d->debuggerServerProc, &Process::readyReadStandardOutput,
|
connect(&d->debuggerServerProc, &Process::readyReadStandardOutput,
|
||||||
this, [this] {
|
this, [this] {
|
||||||
const QByteArray data = d->debuggerServerProc.readAllRawStandardOutput();
|
const QString msg = d->debuggerServerProc.readAllStandardOutput();
|
||||||
const QString msg = d->debuggerServerCodec->toUnicode(
|
|
||||||
data.constData(), data.length(), &d->outputCodecState);
|
|
||||||
runControl()->postMessage(msg, StdOutFormat, false);
|
runControl()->postMessage(msg, StdOutFormat, false);
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(&d->debuggerServerProc, &Process::readyReadStandardError,
|
connect(&d->debuggerServerProc, &Process::readyReadStandardError,
|
||||||
this, [this] {
|
this, [this] {
|
||||||
const QByteArray data = d->debuggerServerProc.readAllRawStandardError();
|
const QString msg = d->debuggerServerProc.readAllStandardError();
|
||||||
const QString msg = d->debuggerServerCodec->toUnicode(
|
|
||||||
data.constData(), data.length(), &d->errorCodecState);
|
|
||||||
runControl()->postMessage(msg, StdErrFormat, false);
|
runControl()->postMessage(msg, StdErrFormat, false);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user