Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tools/projmgr/include/ProjMgrWorker.h
Original file line number Diff line number Diff line change
Expand Up @@ -1113,7 +1113,7 @@ class ProjMgrWorker {
}
m_contexts.clear();
m_ymlOrderedContexts.clear();
m_contexts.clear();
m_processedContexts.clear();
m_contextErrMap.clear();
m_selectedContexts.clear();
m_outputDir.clear();
Expand Down
1 change: 1 addition & 0 deletions tools/projmgr/src/ProjMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1291,6 +1291,7 @@ void ProjMgr::Clear() {
void ProjMgr::InitSolution(const std::string& csolution, const std::string& activeTargetSet, const bool& updateRte) {
Clear();
m_csolutionFile = csolution;
m_worker.SetCsolutionFile(m_csolutionFile);
m_rootDir = RteUtils::ExtractFilePath(m_csolutionFile, false);
m_updateRteFiles = updateRte;
if (activeTargetSet.empty()) {
Expand Down
6 changes: 5 additions & 1 deletion tools/projmgr/src/ProjMgrWorker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,7 @@ bool ProjMgrWorker::InitializeModel() {
if(m_kernel) {
// kernel is already initialized, clear pdsc map
m_kernel->GetPackRegistry()->ClearPdscMap();
m_model->SetRootFileName(m_csolutionFile);
return true;
}
m_packRoot = GetPackRoot();
Expand Down Expand Up @@ -559,7 +560,7 @@ bool ProjMgrWorker::LoadPacks(ContextItem& context) {
PrintContextErrors(context.name);
return false;
}
if (m_loadedPacks.empty() && !LoadAllRelevantPacks()) {
if ((m_loadedPacks.empty() || m_rpcMode) && !LoadAllRelevantPacks()) {
return false;
}
// Filter context specific packs
Expand Down Expand Up @@ -2254,6 +2255,9 @@ bool ProjMgrWorker::ProcessConfigFiles(ContextItem& context) {

bool ProjMgrWorker::CheckConfigPLMFiles(ContextItem& context) {
bool error = false;
if (!context.rteActiveProject) {
return error;
}
for (const auto& fi : context.rteActiveProject->GetFileInstances()) {
// get absolute path to file instance
const string file = fs::path(context.cproject->directory).append(fi.second->GetInstanceName()).generic_string();
Expand Down
7 changes: 7 additions & 0 deletions tools/projmgr/test/src/ProjMgrWorkerUnitTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1859,3 +1859,10 @@ TEST_F(ProjMgrWorkerUnitTests, LoadPacksCaseInsensitive) {

CrossPlatformUtils::SetEnv("CMSIS_PACK_ROOT", cmsisPackRoot);
}

TEST_F(ProjMgrWorkerUnitTests, CheckConfigPLMFiles_NoRteActiveProject) {
ContextItem context;
context.rteActiveProject = nullptr;
// ensure CheckConfigPLMFiles does not crash when rteActiveProject is not initialized
EXPECT_FALSE(CheckConfigPLMFiles(context));
}
Loading