Debug

From Nocturnal.insomniacgames.com

Jump to: navigation, search

Contents

Download

http://nocturnal.insomniacgames.com/releases/Debug

Debug

Debug helps retrieve symbol information (symbol names from addresses or capturing stack traces), processes and reports via email about unhandled exceptions, and queries current virtual address space state.

Symbol Information

Retrieve symbol information from an address:

DWORD64 addr = /* some function address */
std::string symbol = Debug::GetSymbolInfo(addr);

Yields:

0x781B5744 - MSVCR80.dll, exception::`vftable' + 0x1f26c

Retrieve stack traces and translate them into source-level reports:

V_StackFrame stackTrace;
Debug::GetStackTrace(stackTrace); // will capture the current stack including this function
 
...
 
std::string trace;
Debug::Translate(stackTrace, trace); // translates the addresses into source symbols

Yields:

0x781B5744 - MSVCR80.dll, exception::`vftable' + 0x1f26c
0x78158E89 - MSVCR80.dll, CxxThrowException + 0x46
0x78160E7C - MSVCR80.dll, operator new + 0x69

Exception Handling

Debug will capture and dispatch via email a report about an unhandled exceptions that occur in your program's main thread (enable with Debug::EnableExceptionHandling):

void Function()
{
  volatile int* null = 0x0;
  int crash = *null;
}

Yields:

Version:	<hidden>
Username:	<hidden>
Computer:	<hidden>
Command:	rebuild
Build:	        Debug

An unhandled exception has occured
EXCEPTION_ACCESS_VIOLATION [c0000005]

Attempt to read from address 0x00000000

Control Registers:
  EIP = 0x00414E3C  ESP = 0x0013FE84
  EBP = 0x0013FF68  EFL = 0x00010246
Integer Registers:
  EAX = 0x00000000  EBX = 0x7FFFF000
  ECX = 0x0000C4AE  EDX = 0x7C90EB94
  ESI = 0x0013FE84  EDI = 0x0013FF68
Float Control:
  CTRL = 0xFFFF027F  STAT = 0xFFFF4020
  TAGS = 0xFFFFFFFF  EOFF = 0x0041E1C8
  ESEL = 0x04CC001B  DOFF = 0x00426438
  DSEL = 0xFFFF0023
Float Registers:
  ST0 = 0x6D05917C000000003D04 (-1.#IND)
  ST1 = 0x0000000027E0907C71B3 (-1.#IND)
  ST2 = 0x170000004CF513002400 (-1.#IND)
  ST3 = 0x01000000C08C1500C1B3 (-1.#IND)
  ST4 = 0x02000302020000000000 (0)
  ST5 = 0x00040000040004030005 (-1.#IND)
  ST6 = 0x0000000000000080FF3F (1)
  ST7 = 0x0018993915D3598C0240 (8.77193)

Call Stack:
 0x00414E3C - Rebuild.exe, main + 0x3c : rebuild.cpp(323)
 0x00419FC6 - Rebuild.exe, __tmainCRTStartup + 0x1a6 : crtexe.c(597)
 0x00419E0D - Rebuild.exe, mainCRTStartup + 0xd : crtexe.c(414)
 0x7C816FD7 - kernel32.dll, RegisterWaitForInputIdle + 0x49
 
Memory:
 Total Reserved 1060192K bytes
 Total Commit   51708K bytes
 Total Free     2033764K bytes
 Largest Free   1256520K bytes

Environment:
 ComSpec=C:\WINDOWS\system32\cmd.exe
 DIRCMD=/OGN
 NUMBER_OF_PROCESSORS=4
 OS=Windows_NT
 PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.PL;.PSC1
 PERL_SIGNALS=unsafe
 PROCESSOR_ARCHITECTURE=x86
 PROCESSOR_IDENTIFIER=x86 Family 15 Model 4 Stepping 1, GenuineIntel
 PROCESSOR_LEVEL=15
 PROCESSOR_REVISION=0401
 ProgramFiles=C:\Program Files
 PROMPT=$P$G
 SystemDrive=C:
 SystemRoot=C:\WINDOWS
 TEMP=C:\DOCUME~1\geoff\LOCALS~1\Temp
 TMP=C:\DOCUME~1\geoff\LOCALS~1\Temp
 VS71COMNTOOLS=C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Tools\
 VS80COMNTOOLS=C:\Program Files\Microsoft Visual Studio 8\Common7\Tools\
 VS90COMNTOOLS=C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools\
 windir=C:\WINDOWS
Personal tools