reporter.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. // Copyright 2019 yuzu Emulator Project
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #pragma once
  5. #include <array>
  6. #include <optional>
  7. #include <string>
  8. #include <vector>
  9. #include "common/common_types.h"
  10. union ResultCode;
  11. namespace Kernel {
  12. class HLERequestContext;
  13. } // namespace Kernel
  14. namespace Service::FileSystem {
  15. enum class LogMode : u32;
  16. }
  17. namespace Core {
  18. class System;
  19. class Reporter {
  20. public:
  21. explicit Reporter(System& system);
  22. ~Reporter();
  23. void SaveCrashReport(u64 title_id, ResultCode result, u64 set_flags, u64 entry_point, u64 sp,
  24. u64 pc, u64 pstate, u64 afsr0, u64 afsr1, u64 esr, u64 far,
  25. const std::array<u64, 31>& registers, const std::array<u64, 32>& backtrace,
  26. u32 backtrace_size, const std::string& arch, u32 unk10) const;
  27. void SaveSvcBreakReport(u32 type, bool signal_debugger, u64 info1, u64 info2,
  28. std::optional<std::vector<u8>> resolved_buffer = {}) const;
  29. void SaveUnimplementedFunctionReport(Kernel::HLERequestContext& ctx, u32 command_id,
  30. const std::string& name,
  31. const std::string& service_name) const;
  32. void SaveUnimplementedAppletReport(u32 applet_id, u32 common_args_version, u32 library_version,
  33. u32 theme_color, bool startup_sound, u64 system_tick,
  34. std::vector<std::vector<u8>> normal_channel,
  35. std::vector<std::vector<u8>> interactive_channel) const;
  36. void SavePlayReport(u64 title_id, u64 process_id, std::vector<std::vector<u8>> data,
  37. std::optional<u128> user_id = {}) const;
  38. void SaveErrorReport(u64 title_id, ResultCode result,
  39. std::optional<std::string> custom_text_main = {},
  40. std::optional<std::string> custom_text_detail = {}) const;
  41. void SaveFilesystemAccessReport(Service::FileSystem::LogMode log_mode,
  42. std::string log_message) const;
  43. void SaveUserReport() const;
  44. private:
  45. bool IsReportingEnabled() const;
  46. System& system;
  47. };
  48. } // namespace Core