From d367d2731392a35a19856cb7802808356c5b53ac Mon Sep 17 00:00:00 2001 From: Maschell Date: Fri, 13 May 2022 15:41:50 +0200 Subject: [PATCH] Fix logging in serveral spots --- wumsloader/src/entry.cpp | 6 +++--- wumsloader/src/module/ModuleDataFactory.cpp | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/wumsloader/src/entry.cpp b/wumsloader/src/entry.cpp index 1f87f70..edc7b6d 100644 --- a/wumsloader/src/entry.cpp +++ b/wumsloader/src/entry.cpp @@ -157,7 +157,7 @@ std::vector> OrderModulesByDependencies(const std::v continue; } canBreak = false; - DEBUG_FUNCTION_LINE_VERBOSE("Check if we can load %s", curModule->getExportName()); + DEBUG_FUNCTION_LINE_VERBOSE("Check if we can load %s", curModule->getExportName().c_str()); std::vector importsFromOtherModules; for (const auto &curReloc : curModule->getRelocationDataList()) { std::string_view curRPL = curReloc->getImportRPLInformation()->getRPLName(); @@ -166,7 +166,7 @@ std::vector> OrderModulesByDependencies(const std::v } if (curRPL.starts_with("homebrew")) { if (std::find(importsFromOtherModules.begin(), importsFromOtherModules.end(), curRPL) == importsFromOtherModules.end()) { - DEBUG_FUNCTION_LINE_VERBOSE("%s is importing from %s", curModule->getExportName(), curRPL.begin()); + DEBUG_FUNCTION_LINE_VERBOSE("%s is importing from %s", curModule->getExportName().c_str(), curRPL.begin()); importsFromOtherModules.push_back(curRPL); } } @@ -181,7 +181,7 @@ std::vector> OrderModulesByDependencies(const std::v } if (canLoad) { weDidSomething = true; - DEBUG_FUNCTION_LINE_VERBOSE("We can load: %s", curModule->getExportName()); + DEBUG_FUNCTION_LINE_VERBOSE("We can load: %s", curModule->getExportName().c_str()); finalOrder.push_back(curModule); loadedModulesExportNames.emplace_back(curModule->getExportName()); loadedModulesEntrypoints.push_back(curModule->getEntrypoint()); diff --git a/wumsloader/src/module/ModuleDataFactory.cpp b/wumsloader/src/module/ModuleDataFactory.cpp index ae7e691..8672a49 100644 --- a/wumsloader/src/module/ModuleDataFactory.cpp +++ b/wumsloader/src/module/ModuleDataFactory.cpp @@ -304,12 +304,13 @@ std::optional> ModuleDataFactory::load(const std::st return std::nullopt; } - moduleData->setDataPtr(std::move(data), totalSize); - moduleData->setEntrypoint(entrypoint); DEBUG_FUNCTION_LINE("Saved entrypoint as %08X", entrypoint); DEBUG_FUNCTION_LINE("Saved startAddress as %08X", (uint32_t) data.get()); DEBUG_FUNCTION_LINE("Saved endAddress as %08X", (uint32_t) data.get() + totalSize); + moduleData->setEntrypoint(entrypoint); + moduleData->setDataPtr(std::move(data), totalSize); + DEBUG_FUNCTION_LINE("Loaded %s size: %d kilobytes", path.c_str(), totalSize / 1024); return moduleData;