From 39c3322d787d44872d4ba02c0d7d6d0cbf8f9316 Mon Sep 17 00:00:00 2001 From: Ralf Habacker Date: Mon, 16 Nov 2015 19:58:42 +0100 Subject: [PATCH 1/4] Print stack index in backtrace generator on Windows. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92721 --- dbus/dbus-sysdeps-win.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/dbus/dbus-sysdeps-win.c b/dbus/dbus-sysdeps-win.c index fb14e40..37194bf 100644 --- a/dbus/dbus-sysdeps-win.c +++ b/dbus/dbus-sysdeps-win.c @@ -2555,6 +2555,7 @@ static void dump_backtrace_for_thread(HANDLE hThread) STACKFRAME sf; CONTEXT context; DWORD dwImageType; + int i = 0; if (!pStackWalk) if (!init_backtrace()) @@ -2628,15 +2629,15 @@ static void dump_backtrace_for_thread(HANDLE hThread) if (!pSymGetModuleInfo(GetCurrentProcess(), sf.AddrPC.Offset, &ModuleInfo)) - DPRINTF("1\t%p\n", (void*)sf.AddrPC.Offset); + DPRINTF("%3d %p\n", i++, (void*)sf.AddrPC.Offset); else - DPRINTF("2\t%s+0x%lx\n", ModuleInfo.ImageName, + DPRINTF("%3d %s+0x%lx\n", i++, ModuleInfo.ImageName, sf.AddrPC.Offset - ModuleInfo.BaseOfImage); } else if (dwDisplacement) - DPRINTF("3\t%s+0x%lx\n", pSymbol->Name, dwDisplacement); + DPRINTF("%3d %s+0x%lx\n", i++, pSymbol->Name, dwDisplacement); else - DPRINTF("4\t%s\n", pSymbol->Name); + DPRINTF("%3d %s\n", i++, pSymbol->Name); } ResumeThread(hThread); -- 1.8.4.5