diff options
| author | 2019-05-17 21:48:47 -0400 | |
|---|---|---|
| committer | 2019-05-25 16:09:20 -0400 | |
| commit | 34e9736910b029ceb87a24cae1a33a176267c889 (patch) | |
| tree | 623d9b46ce86685384773c773d79e6be970395ad /src | |
| parent | service: Save report on unimplemented function call (diff) | |
| download | yuzu-34e9736910b029ceb87a24cae1a33a176267c889.tar.gz yuzu-34e9736910b029ceb87a24cae1a33a176267c889.tar.xz yuzu-34e9736910b029ceb87a24cae1a33a176267c889.zip | |
fatal: Save report on fatal:u call
Matches offical behavior with creport and replaces old log/text based report system.
Diffstat (limited to 'src')
| -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 @@ | |||
| 16 | #include "core/hle/service/fatal/fatal.h" | 16 | #include "core/hle/service/fatal/fatal.h" |
| 17 | #include "core/hle/service/fatal/fatal_p.h" | 17 | #include "core/hle/service/fatal/fatal_p.h" |
| 18 | #include "core/hle/service/fatal/fatal_u.h" | 18 | #include "core/hle/service/fatal/fatal_u.h" |
| 19 | #include "core/reporter.h" | ||
| 19 | 20 | ||
| 20 | namespace Service::Fatal { | 21 | namespace Service::Fatal { |
| 21 | 22 | ||
| @@ -100,27 +101,10 @@ static void GenerateErrorReport(ResultCode error_code, const FatalInfo& info) { | |||
| 100 | 101 | ||
| 101 | LOG_ERROR(Service_Fatal, "{}", crash_report); | 102 | LOG_ERROR(Service_Fatal, "{}", crash_report); |
| 102 | 103 | ||
| 103 | const std::string crashreport_dir = | 104 | Core::System::GetInstance().GetReporter().SaveCrashReport( |
| 104 | FileUtil::GetUserPath(FileUtil::UserPath::LogDir) + "crash_logs"; | 105 | title_id, error_code, info.set_flags, info.program_entry_point, info.sp, info.pc, |
| 105 | 106 | info.pstate, info.afsr0, info.afsr1, info.esr, info.far, info.registers, info.backtrace, | |
| 106 | if (!FileUtil::CreateFullPath(crashreport_dir)) { | 107 | info.backtrace_size, info.ArchAsString(), info.unk10); |
| 107 | LOG_ERROR( | ||
| 108 | Service_Fatal, | ||
| 109 | "Unable to create crash report directory. Possible log directory permissions issue."); | ||
| 110 | return; | ||
| 111 | } | ||
| 112 | |||
| 113 | const std::time_t t = std::time(nullptr); | ||
| 114 | const std::string crashreport_filename = | ||
| 115 | fmt::format("{}/{:016x}-{:%F-%H%M%S}.log", crashreport_dir, title_id, *std::localtime(&t)); | ||
| 116 | |||
| 117 | auto file = FileUtil::IOFile(crashreport_filename, "wb"); | ||
| 118 | if (file.IsOpen()) { | ||
| 119 | file.WriteString(crash_report); | ||
| 120 | LOG_ERROR(Service_Fatal, "Saving error report to {}", crashreport_filename); | ||
| 121 | } else { | ||
| 122 | LOG_ERROR(Service_Fatal, "Failed to save error report to {}", crashreport_filename); | ||
| 123 | } | ||
| 124 | } | 108 | } |
| 125 | 109 | ||
| 126 | static void ThrowFatalError(ResultCode error_code, FatalType fatal_type, const FatalInfo& info) { | 110 | static void ThrowFatalError(ResultCode error_code, FatalType fatal_type, const FatalInfo& info) { |