Introduce mem dump code
This commit is contained in:
14
include/PSX/Auxiliary/mem_dump.hpp
Normal file
14
include/PSX/Auxiliary/mem_dump.hpp
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
#pragma once
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
namespace JabyEngine {
|
||||||
|
template<typename T>
|
||||||
|
static inline void dump_to_stdoutln(const T& object) {
|
||||||
|
const uint8_t* raw_ptr = reinterpret_cast<const uint8_t*>(&object);
|
||||||
|
|
||||||
|
for(size_t raw_pos = 0; raw_pos < sizeof(T); raw_pos++) {
|
||||||
|
printf("[%02X]", raw_ptr[raw_pos]);
|
||||||
|
}
|
||||||
|
printf("\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user