@@ -32,8 +32,9 @@ import std.stdio; import std.c.stdlib; import std.demangle; import std.conv; +import std.path; extern(Windows){ DWORD GetEnvironmentVariableA(LPCSTR lpName, LPSTR pBuffer, DWORD nSize); void RtlCaptureContext(CONTEXT* ContextRecord); @@ -336,22 +337,27 @@ if(stackframe.AddrPC.Offset != 0){ string lineStr = ""; Dbghelp.DWORD64 offsetFromSymbol = cast(Dbghelp.DWORD64)0; if( Dbghelp.SymGetSymFromAddr64(hProcess,stackframe.AddrPC.Offset,&offsetFromSymbol,Symbol) == TRUE){ - char[] symName = new char[strlen(cast(const(char)*)Symbol.Name.ptr)+1]; + char[] symName = new char[strlen(cast(const(char)*)Symbol.Name.ptr)]; memcpy(symName.ptr,Symbol.Name.ptr,symName.length); string symString = ""; if(symName[0] == 'D') symString = "_"; symString ~= symName; - string demangeledName = demangle(symString); - lineStr ~= demangeledName; + string demangledName = demangle(symString); + bool isOK = true; + for(int i=0; i= 0x80 ) + isOK = false; + if(isOK) + lineStr ~= demangledName; DWORD zeichen = 0; if(Dbghelp.SymGetLineFromAddr64(hProcess,stackframe.AddrPC.Offset,&zeichen,&Line) == TRUE){ char[] fileName = new char[strlen(Line.FileName)]; - fileName[] = Line.FileName[0..fileName.length]; + fileName = std.path.basename( Line.FileName[0..fileName.length] ); lineStr = to!string(fileName ~ "::" ~ to!string(Line.LineNumber) ~ "(" ~ to!string(zeichen) ~ ") " ~ lineStr); } } else {