diff options
Diffstat (limited to '')
-rw-r--r-- | src/core/reporter.cpp | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/core/reporter.cpp b/src/core/reporter.cpp index 85ac81ef7..0becdf642 100644 --- a/src/core/reporter.cpp +++ b/src/core/reporter.cpp @@ -4,11 +4,12 @@ #include <ctime> #include <fstream> +#include <iomanip> #include <fmt/chrono.h> #include <fmt/format.h> #include <fmt/ostream.h> -#include <json.hpp> +#include <nlohmann/json.hpp> #include "common/file_util.h" #include "common/hex_util.h" @@ -16,17 +17,20 @@ #include "core/arm/arm_interface.h" #include "core/core.h" #include "core/hle/kernel/hle_ipc.h" +#include "core/hle/kernel/memory/page_table.h" #include "core/hle/kernel/process.h" #include "core/hle/result.h" #include "core/hle/service/lm/manager.h" +#include "core/memory.h" #include "core/reporter.h" #include "core/settings.h" namespace { std::string GetPath(std::string_view type, u64 title_id, std::string_view timestamp) { - return fmt::format("{}{}/{:016X}_{}.json", FileUtil::GetUserPath(FileUtil::UserPath::LogDir), - type, title_id, timestamp); + return fmt::format("{}{}/{:016X}_{}.json", + Common::FS::GetUserPath(Common::FS::UserPath::LogDir), type, title_id, + timestamp); } std::string GetTimestamp() { @@ -37,13 +41,13 @@ std::string GetTimestamp() { using namespace nlohmann; void SaveToFile(json json, const std::string& filename) { - if (!FileUtil::CreateFullPath(filename)) { + if (!Common::FS::CreateFullPath(filename)) { LOG_ERROR(Core, "Failed to create path for '{}' to save report!", filename); return; } std::ofstream file( - FileUtil::SanitizePath(filename, FileUtil::DirectorySeparator::PlatformDefault)); + Common::FS::SanitizePath(filename, Common::FS::DirectorySeparator::PlatformDefault)); file << std::setw(4) << json << std::endl; } @@ -108,14 +112,13 @@ json GetProcessorStateData(const std::string& architecture, u64 entry_point, u64 json GetProcessorStateDataAuto(Core::System& system) { const auto* process{system.CurrentProcess()}; - const auto& vm_manager{process->VMManager()}; auto& arm{system.CurrentArmInterface()}; Core::ARM_Interface::ThreadContext64 context{}; arm.SaveContext(context); return GetProcessorStateData(process->Is64BitProcess() ? "AArch64" : "AArch32", - vm_manager.GetCodeRegionBaseAddress(), context.sp, context.pc, + process->PageTable().GetCodeRegionStart(), context.sp, context.pc, context.pstate, context.cpu_registers); } @@ -147,7 +150,8 @@ json GetFullDataAuto(const std::string& timestamp, u64 title_id, Core::System& s } template <bool read_value, typename DescriptorType> -json GetHLEBufferDescriptorData(const std::vector<DescriptorType>& buffer, Memory::Memory& memory) { +json GetHLEBufferDescriptorData(const std::vector<DescriptorType>& buffer, + Core::Memory::Memory& memory) { auto buffer_out = json::array(); for (const auto& desc : buffer) { auto entry = json{ @@ -167,7 +171,7 @@ json GetHLEBufferDescriptorData(const std::vector<DescriptorType>& buffer, Memor return buffer_out; } -json GetHLERequestContextData(Kernel::HLERequestContext& ctx, Memory::Memory& memory) { +json GetHLERequestContextData(Kernel::HLERequestContext& ctx, Core::Memory::Memory& memory) { json out; auto cmd_buf = json::array(); |