add simple PC logging facility for debugging. not enabled by default.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@125 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
hrydgard 2008-08-01 20:36:14 +00:00
parent e5940d12dc
commit f895edc10d
2 changed files with 8 additions and 1 deletions

View File

@ -16,6 +16,7 @@
// http://code.google.com/p/dolphin-emu/ // http://code.google.com/p/dolphin-emu/
#include "Common.h" #include "Common.h"
#include "x64Emitter.h" #include "x64Emitter.h"
#include "ABI.h"
#include "CPUDetect.h" #include "CPUDetect.h"
namespace Gen namespace Gen

View File

@ -259,10 +259,16 @@ namespace Jit64
} }
bool ImHereDebug = false; bool ImHereDebug = false;
bool ImHereLog = false;
std::map<u32, int> been_here; std::map<u32, int> been_here;
void ImHere() void ImHere()
{ {
static FILE *f = 0;
if (ImHereLog) {
if (!f)
f = fopen("log.txt", "w");
fprintf(f, "%08x\n", PC);
}
if (been_here.find(PC) != been_here.end()) { if (been_here.find(PC) != been_here.end()) {
been_here.find(PC)->second++; been_here.find(PC)->second++;
if ((been_here.find(PC)->second) & 1023) if ((been_here.find(PC)->second) & 1023)