Merge pull request #10159 from JosJuice/print-callstack-log

Core: Use log variant of PrintCallstack, not print variant
This commit is contained in:
Léo Lam 2021-10-13 01:40:07 +02:00 committed by GitHub
commit 6c1a625f0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 1 additions and 24 deletions

View File

@ -97,28 +97,6 @@ bool GetCallstack(std::vector<CallstackEntry>& output)
return true; return true;
} }
void PrintCallstack()
{
fmt::print("== STACK TRACE - SP = {:08x} ==", PowerPC::ppcState.gpr[1]);
if (LR == 0)
{
fmt::print(" LR = 0 - this is bad");
}
if (g_symbolDB.GetDescription(PC) != g_symbolDB.GetDescription(LR))
{
fmt::print(" * {} [ LR = {:08x} ]", g_symbolDB.GetDescription(LR), LR);
}
WalkTheStack([](u32 func_addr) {
std::string func_desc = g_symbolDB.GetDescription(func_addr);
if (func_desc.empty() || func_desc == "Invalid")
func_desc = "(unknown)";
fmt::print(" * {} [ addr = {:08x} ]", func_desc, func_addr);
});
}
void PrintCallstack(Common::Log::LOG_TYPE type, Common::Log::LOG_LEVELS level) void PrintCallstack(Common::Log::LOG_TYPE type, Common::Log::LOG_LEVELS level)
{ {
GENERIC_LOG_FMT(type, level, "== STACK TRACE - SP = {:08x} ==", PowerPC::ppcState.gpr[1]); GENERIC_LOG_FMT(type, level, "== STACK TRACE - SP = {:08x} ==", PowerPC::ppcState.gpr[1]);

View File

@ -19,7 +19,6 @@ struct CallstackEntry
}; };
bool GetCallstack(std::vector<CallstackEntry>& output); bool GetCallstack(std::vector<CallstackEntry>& output);
void PrintCallstack();
void PrintCallstack(Common::Log::LOG_TYPE type, Common::Log::LOG_LEVELS level); void PrintCallstack(Common::Log::LOG_TYPE type, Common::Log::LOG_LEVELS level);
void PrintDataBuffer(Common::Log::LOG_TYPE type, const u8* data, size_t size, void PrintDataBuffer(Common::Log::LOG_TYPE type, const u8* data, size_t size,
std::string_view title); std::string_view title);

View File

@ -340,7 +340,7 @@ void Interpreter::unknown_instruction(UGeckoInstruction inst)
const u32 opcode = PowerPC::HostRead_U32(last_pc); const u32 opcode = PowerPC::HostRead_U32(last_pc);
const std::string disasm = Common::GekkoDisassembler::Disassemble(opcode, last_pc); const std::string disasm = Common::GekkoDisassembler::Disassemble(opcode, last_pc);
NOTICE_LOG_FMT(POWERPC, "Last PC = {:08x} : {}", last_pc, disasm); NOTICE_LOG_FMT(POWERPC, "Last PC = {:08x} : {}", last_pc, disasm);
Dolphin_Debugger::PrintCallstack(); Dolphin_Debugger::PrintCallstack(Common::Log::POWERPC, Common::Log::LNOTICE);
NOTICE_LOG_FMT( NOTICE_LOG_FMT(
POWERPC, POWERPC,
"\nIntCPU: Unknown instruction {:08x} at PC = {:08x} last_PC = {:08x} LR = {:08x}\n", "\nIntCPU: Unknown instruction {:08x} at PC = {:08x} last_PC = {:08x} LR = {:08x}\n",