mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2024-07-04 23:31:19 +01:00
Moved log backtrace to arm_interface.cpp. Added printing of error code to fatal
This commit is contained in:
parent
08d5663cb8
commit
22d4e10664
4 changed files with 36 additions and 18 deletions
|
@ -1,5 +1,6 @@
|
||||||
add_library(core STATIC
|
add_library(core STATIC
|
||||||
arm/arm_interface.h
|
arm/arm_interface.h
|
||||||
|
arm/arm_interface.cpp
|
||||||
arm/exclusive_monitor.cpp
|
arm/exclusive_monitor.cpp
|
||||||
arm/exclusive_monitor.h
|
arm/exclusive_monitor.h
|
||||||
arm/unicorn/arm_unicorn.cpp
|
arm/unicorn/arm_unicorn.cpp
|
||||||
|
|
26
src/core/arm/arm_interface.cpp
Normal file
26
src/core/arm/arm_interface.cpp
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
// Copyright 2018 yuzu emulator team
|
||||||
|
// Licensed under GPLv2 or any later version
|
||||||
|
// Refer to the license.txt file included.
|
||||||
|
|
||||||
|
#include "arm_interface.h"
|
||||||
|
#include "common/common_types.h"
|
||||||
|
#include "common/logging/log.h"
|
||||||
|
#include "core/memory.h"
|
||||||
|
|
||||||
|
namespace Core {
|
||||||
|
void ARM_Interface::LogBacktrace() {
|
||||||
|
VAddr fp = GetReg(29);
|
||||||
|
VAddr lr = GetReg(30);
|
||||||
|
VAddr sp = GetReg(13);
|
||||||
|
VAddr pc = GetPC();
|
||||||
|
LOG_ERROR(Core_ARM, "Backtrace, sp={:016X}, pc={:016X}", sp, pc);
|
||||||
|
for (;;) {
|
||||||
|
LOG_ERROR(Core_ARM, "{:016X}", lr);
|
||||||
|
if (!fp) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
lr = Memory::Read64(fp + 8) - 4;
|
||||||
|
fp = Memory::Read64(fp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}; // namespace Core
|
|
@ -6,8 +6,6 @@
|
||||||
|
|
||||||
#include <array>
|
#include <array>
|
||||||
#include "common/common_types.h"
|
#include "common/common_types.h"
|
||||||
#include "common/logging/log.h"
|
|
||||||
#include "core/memory.h"
|
|
||||||
|
|
||||||
namespace Kernel {
|
namespace Kernel {
|
||||||
enum class VMAPermission : u8;
|
enum class VMAPermission : u8;
|
||||||
|
@ -144,21 +142,13 @@ public:
|
||||||
/// Prepare core for thread reschedule (if needed to correctly handle state)
|
/// Prepare core for thread reschedule (if needed to correctly handle state)
|
||||||
virtual void PrepareReschedule() = 0;
|
virtual void PrepareReschedule() = 0;
|
||||||
|
|
||||||
void LogBacktrace() {
|
/// fp (= r29) points to the last frame record.
|
||||||
VAddr fp = GetReg(29);
|
/// Note that this is the frame record for the *previous* frame, not the current one.
|
||||||
VAddr lr = GetReg(30);
|
/// Note we need to subtract 4 from our last read to get the proper address
|
||||||
VAddr sp = GetReg(13);
|
/// Frame records are two words long:
|
||||||
VAddr pc = GetPC();
|
/// fp+0 : pointer to previous frame record
|
||||||
LOG_ERROR(Core_ARM, "Backtrace, sp={:016X}, pc={:016X}", sp, pc);
|
/// fp+8 : value of lr for frame
|
||||||
for (;;) {
|
void LogBacktrace();
|
||||||
LOG_ERROR(Core_ARM, "{:016X}", lr);
|
|
||||||
if (!fp) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
lr = Memory::Read64(fp + 8) - 4;
|
|
||||||
fp = Memory::Read64(fp);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Core
|
} // namespace Core
|
||||||
|
|
|
@ -111,7 +111,8 @@ static void GenerateErrorReport(ResultCode error_code, const FatalInfo& info) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ThrowFatalError(ResultCode error_code, FatalType fatal_type, const FatalInfo& info) {
|
static void ThrowFatalError(ResultCode error_code, FatalType fatal_type, const FatalInfo& info) {
|
||||||
LOG_ERROR(Service_Fatal, "Threw fatal error type {}", static_cast<u32>(fatal_type));
|
LOG_ERROR(Service_Fatal, "Threw fatal error type {} with error code 0x{:X}",
|
||||||
|
static_cast<u32>(fatal_type), error_code.raw);
|
||||||
switch (fatal_type) {
|
switch (fatal_type) {
|
||||||
case FatalType::ErrorReportAndScreen:
|
case FatalType::ErrorReportAndScreen:
|
||||||
GenerateErrorReport(error_code, info);
|
GenerateErrorReport(error_code, info);
|
||||||
|
|
Loading…
Reference in a new issue