From e4debaf4ba7ac7da6321883492b08d755386dacc Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Thu, 19 Sep 2024 13:20:02 +0200 Subject: [TRACE] Some better trace for a few function call --- src/emu/x64int3.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src') diff --git a/src/emu/x64int3.c b/src/emu/x64int3.c index b0f452a2..2f2ce756 100644 --- a/src/emu/x64int3.c +++ b/src/emu/x64int3.c @@ -256,6 +256,8 @@ void x64Int3(x64emu_t* emu, uintptr_t* addr) } else if (!strcmp(s, "vfprintf") || !strcmp(s, "my_vfprintf")) { tmp = (char*)((R_RSI>2)?R_RSI:R_RDX); snprintf(buff, 256, "%04d|%p: Calling %s(%p, \"%s\", ...)", tid, *(void**)(R_RSP), s, (void*)R_RDI, (tmp)?tmp:"(nil)"); + } else if (!strcmp(s, "g_source_set_name")) { + snprintf(buff, 256, "%04d|%p: Calling %s(%p, \"%s\")", tid, *(void**)(R_RSP), s, (void*)R_RDI, (char*)R_RSI); } else if (!strcmp(s, "getcwd")) { post = 2; snprintf(buff, 256, "%04d|%p: Calling %s(%p, %zu)", tid, *(void**)(R_RSP), s, (void*)R_RDI, R_RSI); @@ -263,6 +265,9 @@ void x64Int3(x64emu_t* emu, uintptr_t* addr) tmp = (char*)(R_RDI); perr = 1; snprintf(buff, 256, "%04d|%p: Calling %s(\"%s\", %d)", tid, *(void**)(R_RSP), s, tmp?tmp:"nil", R_ESI); + } else if (!strcmp(s, "xcb_wait_for_event") || !strcmp(s, "xcb_poll_for_queued_event") || !strcmp(s, "xcb_poll_for_event")) { + post = 9; + snprintf(buff, 256, "%04d|%p: Calling %s(%p)", tid, *(void**)(R_RSP), s, (void*)R_RDI); } else if (!strcmp(s, "glXGetProcAddress") || !strcmp(s, "SDL_GL_GetProcAddress") || !strcmp(s, "glXGetProcAddressARB")) { tmp = (char*)(R_RDI); snprintf(buff, 256, "%04d|%p: Calling %s(\"%s\")", tid, *(void**)(R_RSP), s, (tmp)?tmp:"(nil)"); @@ -351,6 +356,11 @@ void x64Int3(x64emu_t* emu, uintptr_t* addr) snprintf(buff2, 64, "[%s%s] ", buff5, (n==S_EAX)?"":"..."); } break; + case 9: if(R_RAX) { + uint8_t type = *(uint8_t*)(R_RAX); + snprintf(buff2, 64, "[type=%d]", type); + } + break; } if(perr==1 && (S_EAX)<0) snprintf(buff3, 64, " (errno=%d:\"%s\")", errno, strerror(errno)); -- cgit 1.4.1