Skip to content

Instantly share code, notes, and snippets.

@exjam
Last active September 27, 2017 20:30
Show Gist options
  • Save exjam/c851f6b3cf5ac089c15081ac0acdeffe to your computer and use it in GitHub Desktop.
Save exjam/c851f6b3cf5ac089c15081ac0acdeffe to your computer and use it in GitHub Desktop.

After https://github.com/decaf-emu/decaf-emu/blob/master/src/libdecaf/src/debugger/debugger_ui_manager.cpp#L16

#include "kernel/kernel_loader.h"

Insert:

#include "kernel/kernel_memory.h

After https://github.com/decaf-emu/decaf-emu/blob/master/src/libdecaf/src/debugger/debugger_ui_manager.cpp#L456

      if (ImGui::MenuItem("Reset JIT Profile Data", ResetJitProfileHotKey, false, true)) {
         cpu::jit::resetProfileStats();
      }

Insert:

     if (ImGui::MenuItem("Dump Memory", nullptr, false, true)) {
        FILE *fh = fopen("memory.dmp", "wb");
        if (fh) {
           auto appHeapRange = kernel::getVirtualRange(kernel::VirtualRegion::AppHeapData);
           auto ptr = cpu::VirtualPointer<uint8_t> { appHeapRange.start };
           fwrite(ptr.getRawPointer(), 1, appHeapRange.size, fh);
           fclose(fh);
        }
     }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment