2018-06-25 11:38:54 +01:00
|
|
|
#pragma once
|
|
|
|
#include <switch.h>
|
|
|
|
|
|
|
|
#include "creport_debug_types.hpp"
|
|
|
|
|
|
|
|
struct CodeInfo {
|
|
|
|
char name[0x20];
|
2018-06-25 16:50:36 +01:00
|
|
|
u8 build_id[0x20];
|
2018-06-25 11:38:54 +01:00
|
|
|
u64 start_address;
|
|
|
|
u64 end_address;
|
|
|
|
};
|
|
|
|
|
|
|
|
class CodeList {
|
|
|
|
private:
|
|
|
|
static const size_t max_code_count = 0x10;
|
|
|
|
u32 code_count;
|
|
|
|
CodeInfo code_infos[max_code_count];
|
|
|
|
public:
|
|
|
|
CodeList() : code_count(0), code_infos({}) { }
|
|
|
|
|
|
|
|
void ReadCodeRegionsFromProcess(Handle debug_handle, u64 pc, u64 lr);
|
|
|
|
private:
|
|
|
|
bool TryFindCodeRegion(Handle debug_handle, u64 guess, u64 *address);
|
2018-06-25 16:50:36 +01:00
|
|
|
void GetCodeInfoName(u64 debug_handle, u64 ro_address, char *name);
|
|
|
|
void GetCodeInfoBuildId(u64 debug_handle, u64 ro_address, u8 *build_id);
|
2018-06-25 11:38:54 +01:00
|
|
|
};
|