forked from qt-creator/qt-creator
Only download from remote when we absolutely have to
If the kit includes a correctly configured sysroot gdbserver will tell us our hostPath. Respect that hostPath if it exists, otherwise fall back to remote debug. Also, populate the hostPath with the symbol file from the run parameters. Task-number: QTCREATORBUG-29614 Change-Id: I3838cd44aa96d7dfcd4ded660b8102a1532c5362 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -469,10 +469,10 @@ void GdbEngine::handleAsyncOutput(const QStringView asyncClass, const GdbMi &res
|
||||
Module module;
|
||||
module.startAddress = 0;
|
||||
module.endAddress = 0;
|
||||
module.hostPath = result["host-name"].data();
|
||||
module.hostPath = Utils::FilePath::fromString(result["host-name"].data());
|
||||
const QString target = result["target-name"].data();
|
||||
module.modulePath = runParameters().inferior.command.executable().withNewPath(target);
|
||||
module.moduleName = QFileInfo(module.hostPath).baseName();
|
||||
module.moduleName = module.hostPath.baseName();
|
||||
modulesHandler()->updateModule(module);
|
||||
} else if (asyncClass == u"library-unloaded") {
|
||||
// Archer has 'id="/usr/lib/libdrm.so.2",
|
||||
@@ -3926,6 +3926,7 @@ void GdbEngine::handleGdbStarted()
|
||||
module.startAddress = 0;
|
||||
module.endAddress = 0;
|
||||
module.modulePath = rp.inferior.command.executable();
|
||||
module.hostPath = rp.symbolFile;
|
||||
module.moduleName = "<executable>";
|
||||
modulesHandler()->updateModule(module);
|
||||
|
||||
|
@@ -273,9 +273,16 @@ void ModulesHandler::removeModule(const FilePath &modulePath)
|
||||
m_model->destroyItem(item);
|
||||
}
|
||||
|
||||
static FilePath pickPath(const FilePath &hostPath, const FilePath &modulePath)
|
||||
{
|
||||
if (!hostPath.isEmpty() && hostPath.exists())
|
||||
return hostPath;
|
||||
return modulePath; // Checking if this exists can be slow, delay it for as long as possible
|
||||
}
|
||||
|
||||
void ModulesHandler::updateModule(const Module &module)
|
||||
{
|
||||
const FilePath path = module.modulePath;
|
||||
const FilePath path = pickPath(module.hostPath, module.modulePath);
|
||||
if (path.isEmpty())
|
||||
return;
|
||||
|
||||
|
@@ -71,7 +71,7 @@ public:
|
||||
};
|
||||
QString moduleName;
|
||||
Utils::FilePath modulePath;
|
||||
QString hostPath;
|
||||
Utils::FilePath hostPath;
|
||||
SymbolReadState symbolsRead = UnknownReadState;
|
||||
quint64 startAddress = 0;
|
||||
quint64 endAddress = 0;
|
||||
|
Reference in New Issue
Block a user