Fix printing

This commit is contained in:
wheremyfoodat 2022-09-15 17:56:05 +03:00
parent c33d7e5dfb
commit cd168bca56
2 changed files with 1 additions and 3 deletions

View file

@ -14,6 +14,7 @@ std::optional<u32> Memory::loadELF(std::filesystem::path& path) {
auto segNum = reader.segments.size();
printf("Number of segments: %d\n", segNum);
printf(" # Perms Vaddr File Size Mem Size\n");
for (int i = 0; i < segNum; ++i) {
const auto seg = reader.segments[i];
const auto flags = seg->get_flags();
@ -27,7 +28,6 @@ std::optional<u32> Memory::loadELF(std::filesystem::path& path) {
const bool w = (flags & 0b010) != 0;
const bool x = (flags & 0b001) != 0;
printf(" # Perms Vaddr File Size Mem Size\n");
printf("[%d] (%c%c%c)\t%08X\t%08X\t%08X\n", i, r ? 'r' : '-', w ? 'w' : '-', x ? 'x' : '-', vaddr, fileSize, memorySize);
// Assert that the segment will be loaded in the executable region. If it isn't then panic.

View file

@ -46,7 +46,6 @@ u32 Memory::read32(u32 vaddr) {
uintptr_t pointer = readTable[page];
if (pointer != 0) [[likely]] {
printf("Read %08X from %08X\n", *(u32*)(pointer + offset), vaddr);
return *(u32*)(pointer + offset);
} else {
Helpers::panic("Unimplemented 32-bit read, addr: %08X", vaddr);
@ -67,7 +66,6 @@ void Memory::write32(u32 vaddr, u32 value) {
uintptr_t pointer = writeTable[page];
if (pointer != 0) [[likely]] {
printf("Wrote %08X to %08X\n", value, vaddr);
*(u32*)(pointer + offset) = value;
} else {
Helpers::panic("Unimplemented 32-bit write, addr: %08X, val: %08X", vaddr, value);