forked from qt-creator/qt-creator
GoCmdBridge: Add some hint related to the remote device to debug output
Also, some timing. Change-Id: Iab8a1c141a6f7ee79ca245982452fb10a35afb31 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
@@ -65,7 +65,13 @@ Result FileAccess::deployAndInit(const FilePath &libExecPath, const FilePath &re
|
||||
if (!whichDD) // TODO: Support Windows?
|
||||
return Result::Error(Tr::tr("Could not find dd on remote host: %1").arg(whichDD.error()));
|
||||
|
||||
qCDebug(faLog) << "Found dd on remote host:" << *whichDD;
|
||||
QElapsedTimer timer;
|
||||
timer.start();
|
||||
auto deco = [&] {
|
||||
return QString("%1 (%2 ms)").arg(remoteRootPath.host()).arg(timer.elapsed());
|
||||
};
|
||||
|
||||
qCDebug(faLog) << deco() << "Found dd on remote host:" << *whichDD;
|
||||
|
||||
const expected_str<QString> unameOs = run({remoteRootPath.withNewPath("uname"), {"-s"}});
|
||||
if (!unameOs) {
|
||||
@@ -76,7 +82,7 @@ Result FileAccess::deployAndInit(const FilePath &libExecPath, const FilePath &re
|
||||
if (!osType)
|
||||
return Result::Error(osType.error());
|
||||
|
||||
qCDebug(faLog) << "Remote host OS:" << *unameOs;
|
||||
qCDebug(faLog) << deco() << "Remote host OS:" << *unameOs;
|
||||
|
||||
const expected_str<QString> unameArch = run({remoteRootPath.withNewPath("uname"), {"-m"}});
|
||||
if (!unameArch) {
|
||||
@@ -88,7 +94,7 @@ Result FileAccess::deployAndInit(const FilePath &libExecPath, const FilePath &re
|
||||
if (!osArch)
|
||||
return Result::Error(osArch.error());
|
||||
|
||||
qCDebug(faLog) << "Remote host architecture:" << *unameArch;
|
||||
qCDebug(faLog) << deco() << "Remote host architecture:" << *unameArch;
|
||||
|
||||
const Utils::expected_str<Utils::FilePath> cmdBridgePath
|
||||
= Client::getCmdBridgePath(*osType, *osArch, libExecPath);
|
||||
@@ -99,7 +105,7 @@ Result FileAccess::deployAndInit(const FilePath &libExecPath, const FilePath &re
|
||||
.arg(cmdBridgePath.error()));
|
||||
}
|
||||
|
||||
qCDebug(faLog) << "Using cmdbridge at:" << *cmdBridgePath;
|
||||
qCDebug(faLog) << deco() << "Using cmdbridge at:" << *cmdBridgePath;
|
||||
|
||||
if (remoteRootPath.needsDevice()) {
|
||||
const auto cmdBridgeFileData = cmdBridgePath->fileContents();
|
||||
@@ -117,10 +123,12 @@ Result FileAccess::deployAndInit(const FilePath &libExecPath, const FilePath &re
|
||||
QString("Could not create temporary file: %1").arg(tmpFile.error()));
|
||||
}
|
||||
|
||||
qCDebug(faLog) << "Using temporary file:" << *tmpFile;
|
||||
qCDebug(faLog) << deco() << "Using temporary file:" << *tmpFile;
|
||||
const auto dd = run({remoteRootPath.withNewPath("dd"), {"of=" + *tmpFile, "bs=1"}},
|
||||
*cmdBridgeFileData);
|
||||
|
||||
qCDebug(faLog) << deco() << "dd run";
|
||||
|
||||
const auto makeExecutable = run({remoteRootPath.withNewPath("chmod"), {"+x", *tmpFile}});
|
||||
|
||||
if (!makeExecutable) {
|
||||
|
Reference in New Issue
Block a user