diff options
author | Zach Hilman <zachhilman@gmail.com> | 2019-05-18 03:48:47 +0200 |
---|---|---|
committer | Zach Hilman <zachhilman@gmail.com> | 2019-05-25 22:09:20 +0200 |
commit | 34e9736910b029ceb87a24cae1a33a176267c889 (patch) | |
tree | 623d9b46ce86685384773c773d79e6be970395ad | |
parent | service: Save report on unimplemented function call (diff) | |
download | yuzu-34e9736910b029ceb87a24cae1a33a176267c889.tar yuzu-34e9736910b029ceb87a24cae1a33a176267c889.tar.gz yuzu-34e9736910b029ceb87a24cae1a33a176267c889.tar.bz2 yuzu-34e9736910b029ceb87a24cae1a33a176267c889.tar.lz yuzu-34e9736910b029ceb87a24cae1a33a176267c889.tar.xz yuzu-34e9736910b029ceb87a24cae1a33a176267c889.tar.zst yuzu-34e9736910b029ceb87a24cae1a33a176267c889.zip |
-rw-r--r-- | src/core/hle/service/fatal/fatal.cpp | 26 |
1 files changed, 5 insertions, 21 deletions
diff --git a/src/core/hle/service/fatal/fatal.cpp b/src/core/hle/service/fatal/fatal.cpp index 2c229bcad..fe49c2161 100644 --- a/src/core/hle/service/fatal/fatal.cpp +++ b/src/core/hle/service/fatal/fatal.cpp @@ -16,6 +16,7 @@ #include "core/hle/service/fatal/fatal.h" #include "core/hle/service/fatal/fatal_p.h" #include "core/hle/service/fatal/fatal_u.h" +#include "core/reporter.h" namespace Service::Fatal { @@ -100,27 +101,10 @@ static void GenerateErrorReport(ResultCode error_code, const FatalInfo& info) { LOG_ERROR(Service_Fatal, "{}", crash_report); - const std::string crashreport_dir = - FileUtil::GetUserPath(FileUtil::UserPath::LogDir) + "crash_logs"; - - if (!FileUtil::CreateFullPath(crashreport_dir)) { - LOG_ERROR( - Service_Fatal, - "Unable to create crash report directory. Possible log directory permissions issue."); - return; - } - - const std::time_t t = std::time(nullptr); - const std::string crashreport_filename = - fmt::format("{}/{:016x}-{:%F-%H%M%S}.log", crashreport_dir, title_id, *std::localtime(&t)); - - auto file = FileUtil::IOFile(crashreport_filename, "wb"); - if (file.IsOpen()) { - file.WriteString(crash_report); - LOG_ERROR(Service_Fatal, "Saving error report to {}", crashreport_filename); - } else { - LOG_ERROR(Service_Fatal, "Failed to save error report to {}", crashreport_filename); - } + Core::System::GetInstance().GetReporter().SaveCrashReport( + title_id, error_code, info.set_flags, info.program_entry_point, info.sp, info.pc, + info.pstate, info.afsr0, info.afsr1, info.esr, info.far, info.registers, info.backtrace, + info.backtrace_size, info.ArchAsString(), info.unk10); } static void ThrowFatalError(ResultCode error_code, FatalType fatal_type, const FatalInfo& info) { |