mirror of
https://github.com/open-goal/jak-project
synced 2026-05-25 15:25:31 -04:00
951f31878e
* track where segments are when debugging * missing windows include * figure out what function we're in * addr to IR is working
31 lines
896 B
C++
31 lines
896 B
C++
#include <utility>
|
|
#include <vector>
|
|
#include "DebugInfo.h"
|
|
#include "third-party/fmt/core.h"
|
|
|
|
DebugInfo::DebugInfo(std::string obj_name) : m_obj_name(std::move(obj_name)) {}
|
|
|
|
std::string FunctionDebugInfo::disassemble_debug_info(bool* had_failure) {
|
|
std::string result = fmt::format("[{}]\n", name);
|
|
std::vector<u8> data;
|
|
u8 temp[128];
|
|
for (const auto& x : instructions) {
|
|
auto count = x.instruction.emit(temp);
|
|
for (int i = 0; i < count; i++) {
|
|
data.push_back(temp[i]);
|
|
}
|
|
}
|
|
|
|
result += disassemble_x86_function(data.data(), data.size(), 0x10000, 0x10000, instructions, irs,
|
|
had_failure);
|
|
|
|
return result;
|
|
}
|
|
|
|
std::string DebugInfo::disassemble_debug_functions(bool* had_failure) {
|
|
std::string result;
|
|
for (auto& kv : m_functions) {
|
|
result += kv.second.disassemble_debug_info(had_failure) + "\n\n";
|
|
}
|
|
return result;
|
|
} |