Fix debugging on Android arm64/x86_64

On Android 64, there is no lib/ symlink anymore, so we need to upload
gdbserver from QtCreator.

Change-Id: Ib6f6d9b623dc61b72dd434ce1b3b409e880bdeaa
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
This commit is contained in:
BogDan Vatra
2018-10-01 14:22:49 +03:00
parent 8f987866b6
commit 25264d9bd9
8 changed files with 71 additions and 25 deletions

View File

@@ -443,7 +443,8 @@ static bool isGuiThread()
}
SynchronousProcessResponse SynchronousProcess::run(const QString &binary,
const QStringList &args)
const QStringList &args,
const QByteArray &writeData)
{
if (debug)
qDebug() << '>' << Q_FUNC_INFO << binary << args;
@@ -454,8 +455,20 @@ SynchronousProcessResponse SynchronousProcess::run(const QString &binary,
// executable cannot be found in the path. Do not start the
// event loop in that case.
d->m_binary = binary;
d->m_process.start(binary, args, QIODevice::ReadOnly);
d->m_process.closeWriteChannel();
d->m_process.start(binary, args, writeData.isEmpty() ? QIODevice::ReadOnly : QIODevice::ReadWrite);
connect(&d->m_process, &QProcess::started, this, [this, writeData] {
if (!writeData.isEmpty()) {
int pos = 0;
int sz = writeData.size();
do {
d->m_process.waitForBytesWritten();
auto res = d->m_process.write(writeData.constData() + pos, sz - pos);
if (res > 0) pos += res;
} while (pos < sz);
d->m_process.waitForBytesWritten();
}
d->m_process.closeWriteChannel();
});
if (!d->m_startFailure) {
d->m_timer.start();
if (isGuiThread())