BareMetal: Choose peripheral description file on debug provider page

... instead of device page.

Reason is that a path to the peripheral description file comes from the
inside of the provider for some providers (e.g. for the UVSC provider at
parsing the selected "Software Device Pack" file).

This complicates a code for assigning of the selected peripheral
description file path to the device configuration page.

So, it is makes sense to make it possible to choose a peripheral
description file from the debug server provider page. In this case we
will pass a path to the selected peripheral description file via the
runnable's extra data variable.

Tested with STM32 NUCLEO-F767ZI board on Windows.

Change-Id: Iec4d738dd236449969fd669e7fbe58da3a660938
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Denis Shienkov
2020-03-06 13:47:08 +03:00
parent 4894afee52
commit fdf383cf37
8 changed files with 64 additions and 54 deletions

View File

@@ -682,9 +682,9 @@ static void handleGroup(QXmlStreamReader &in, PeripheralRegisterGroups &groups)
groups.push_back(group);
}
static PeripheralRegisterGroups availablePeripheralRegisterGroups(const QString &filePath)
static PeripheralRegisterGroups availablePeripheralRegisterGroups(const FilePath &filePath)
{
QFile f(filePath);
QFile f(filePath.toString());
if (!f.open(QIODevice::ReadOnly))
return {};
@@ -716,14 +716,13 @@ void PeripheralRegisterHandler::updateRegisterGroups()
{
clear();
const auto dev = m_engine->device();
QTC_ASSERT(dev, return);
const DebuggerRunParameters &rp = m_engine->runParameters();
const FilePath peripheralDescriptionFile = FilePath::fromVariant(
rp.inferior.extraData.value(Debugger::Constants::kPeripheralDescriptionFile));
const QString filePath = dev->peripheralDescriptionFilePath();
if (filePath.isEmpty())
if (!peripheralDescriptionFile.exists())
return;
m_peripheralRegisterGroups = availablePeripheralRegisterGroups(filePath);
m_peripheralRegisterGroups = availablePeripheralRegisterGroups(peripheralDescriptionFile);
}
void PeripheralRegisterHandler::updateRegister(quint64 address, quint64 value)