uppsrc: Crash moved to archive

git-svn-id: svn://ultimatepp.org/upp/trunk@15310 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2020-10-27 08:34:09 +00:00
parent 4bc92b475f
commit ff1c426cac
12 changed files with 646 additions and 601 deletions

View file

@ -1,16 +1,16 @@
description "Utility to examine content of .crash and .map files\377";
uses
CtrlLib;
file
imagehlp.dli,
crash.cpp,
crash.iml,
crash.rc,
Info readonly separator,
Copying;
mainconfig
"" = "GUI";
description "Utility to examine content of .crash and .map files\377";
uses
CtrlLib;
file
imagehlp.dli,
crash.cpp,
crash.iml,
crash.rc,
Info readonly separator,
Copying;
mainconfig
"" = "GUI";

View file

@ -1,253 +1,253 @@
#include <CtrlLib/CtrlLib.h>
#include <winver.h>
#include <imagehlp.h>
using namespace Upp;
#define DLLFILENAME "imagehlp.dll"
#define DLIHEADER "imagehlp.dli"
#define DLIMODULE Imagehlp
#include <Core/dli.h>
Vector<unsigned > address;
Vector<String> name;
String mapname;
void LoadMap(String fn)
{
String fpos = GetFileName(fn);
int dp = fpos.Find('.');
if(dp >= 0)
fpos.Trim(dp);
fn = AppendFileName(GetFileDirectory(fn), fpos) + ".map";
if(mapname == fn)
return;
mapname = fn;
address.Clear();
name.Clear();
String map = LoadFile(fn);
if(IsNull(map))
return;
const char *p = map;
while(*p)
if(*p++ == '\n' && !memcmp(p, " 0001:", 6)) {
p += 5;
while(IsXDigit(*++p))
;
while(*p == ' ')
p++;
const char *b = p;
while((byte)*p > ' ')
p++;
const char *e = p;
while(*p == ' ')
p++;
if(e > b && IsXDigit(*p)) {
unsigned addr = strtoul(p, 0, 16);
address.Add(addr);
name.Add(String(b, e));
}
}
IndexSort(address, name, StdLess<unsigned>());
}
String Fname(dword addr, bool& recognized) {
int pos = BinFindIndex(address, addr + 1) - 1;
String s;
s.Cat(Format("0x%08x", (int)addr));
if(pos >= 0) {
dword off = addr - address[pos];
if(off < 8000) {
s << ": ";
if(Imagehlp()) {
char nm[1024];
Imagehlp().UnDecorateSymbolName(name[pos], nm, 1024, UNDNAME_NO_ACCESS_SPECIFIERS|
UNDNAME_NO_MEMBER_TYPE|UNDNAME_NO_MS_KEYWORDS);
s << nm;
}
else
s << name[pos];
s << Format(" + 0x%x bytes", (int)off);
recognized = true;
return s;
}
}
s << " = " << Format("%d [%d, %d]", (int)addr, (int)LOWORD(addr), (int)HIWORD(addr));
recognized = false;
return s;
}
String LoadCrashFile(String filename)
{
LoadMap(filename);
FileIn in(filename);
String text;
text << "Crash log " << GetFileName(filename) << "\n";
if(name.GetCount() == 0)
text << "No mapfile found" << "\n";
dword version;
dword code, address;
int npar;
in % version;
in % code % address % npar;
Vector<dword> info;
Vector<dword> stack;
bool r;
int i;
while(npar--)
in % info.Add();
switch(code) {
case EXCEPTION_ACCESS_VIOLATION:
text << "Access violation ";
if(info.GetCount() >= 2)
text << (info[0] ? "writing" : "reading") << Format(" at 0x%08x", (int)info[1]);
break;
#define MEX(id) case id: text << #id; break;
MEX(EXCEPTION_DATATYPE_MISALIGNMENT)
MEX(EXCEPTION_BREAKPOINT)
MEX(EXCEPTION_SINGLE_STEP)
MEX(EXCEPTION_ARRAY_BOUNDS_EXCEEDED)
MEX(EXCEPTION_FLT_DENORMAL_OPERAND)
MEX(EXCEPTION_FLT_DIVIDE_BY_ZERO)
MEX(EXCEPTION_FLT_INEXACT_RESULT)
MEX(EXCEPTION_FLT_INVALID_OPERATION)
MEX(EXCEPTION_FLT_OVERFLOW)
MEX(EXCEPTION_FLT_STACK_CHECK)
MEX(EXCEPTION_FLT_UNDERFLOW)
MEX(EXCEPTION_INT_DIVIDE_BY_ZERO)
MEX(EXCEPTION_INT_OVERFLOW)
MEX(EXCEPTION_PRIV_INSTRUCTION)
MEX(EXCEPTION_IN_PAGE_ERROR)
MEX(EXCEPTION_ILLEGAL_INSTRUCTION)
MEX(EXCEPTION_NONCONTINUABLE_EXCEPTION)
MEX(EXCEPTION_STACK_OVERFLOW)
MEX(EXCEPTION_INVALID_DISPOSITION)
MEX(EXCEPTION_GUARD_PAGE)
MEX(EXCEPTION_INVALID_HANDLE)
default:
text << Format("Exception 0x%08x", (int)code);
}
text << '\n' << Fname(address, r) << '\n';
while(!in.IsEof())
in % stack.Add();
text << "\nRecognized stack dwords:\n";
for(i = 0; i < stack.GetCount(); i++) {
String s = Fname(stack[i], r);
if(r) text << "\t" << s << '\n';
}
text << "\nComplete stack:\n";
for(i = 0; i < stack.GetCount(); i++)
text << "\t" << Fname(stack[i], r) << '\n';
return text;
}
class CrashViewer : public TopWindow {
public:
typedef CrashViewer CLASSNAME;
CrashViewer();
void Run();
bool OpenFile();
virtual bool Key(dword key, int repcnt);
void LoadCrashFile();
private:
Splitter splitter;
ArrayCtrl crashfiles;
LineEdit crashdump;
};
CrashViewer::CrashViewer()
{
Sizeable().Zoomable();
splitter.Horz(crashfiles, crashdump);
splitter.SetPos(3000);
Add(splitter.SizePos());
crashfiles.AutoHideSb().NoHeader();
crashfiles.AddColumn();
crashfiles.WhenCursor = THISBACK(LoadCrashFile);
crashdump.SetFont(Courier(14));
}
void CrashViewer::Run()
{
if(!OpenFile())
return;
LoadCrashFile();
TopWindow::Run();
}
bool CrashViewer::Key(dword key, int repcnt)
{
if(key == K_CTRL_O) {
OpenFile();
return true;
}
return TopWindow::Key(key, repcnt);
}
bool CrashViewer::OpenFile()
{
FileSelector fs;
LoadFromFile(fs);
fs.Type("Crash file", "*.crash");
fs.DefaultExt("crash");
fs.Multi();
if(!fs.ExecuteOpen()) return false;
StoreToFile(fs);
int newln = -1;
for(int i = 0; i < fs.GetCount(); i++) {
String path = fs[i];
int f = crashfiles.Find(path);
if(f < 0) {
newln = crashfiles.GetCount();
crashfiles.Add(path);
}
}
if(newln >= 0)
crashfiles.SetCursor(newln);
return true;
}
void CrashViewer::LoadCrashFile()
{
String fn = Null;
if(crashfiles.IsCursor())
fn = crashfiles.Get(0);
String title = fn;
if(!IsNull(title))
title << " - crash analyzer";
else
title << "Crash analyzer";
Title(title);
if(IsNull(fn))
crashdump <<= Null;
else
crashdump <<= ::LoadCrashFile(fn);
}
GUI_APP_MAIN
{
SetDefaultCharset(CHARSET_WIN1250);
CrashViewer viewer;
viewer.Run();
/*
FileSelector fs;
LoadFromFile(fs);
fs.Type("Crash file", "*.crash");
if(!fs.ExecuteOpen()) return;
String text = LoadCrashFile(~fs);
TopWindow win;
win.Title("Crash analyzer - " + ~fs).Sizeable().Zoomable();
win.Icon(Image::Icon(100, true), Image::Icon(100, false));
LineEdit edit;
edit.SetFont(Courier(14));
edit <<= text;
win.Add(edit.SizePos());
win.Run();
*/
// StoreToFile(fs);
}
#include <CtrlLib/CtrlLib.h>
#include <winver.h>
#include <imagehlp.h>
using namespace Upp;
#define DLLFILENAME "imagehlp.dll"
#define DLIHEADER "imagehlp.dli"
#define DLIMODULE Imagehlp
#include <Core/dli.h>
Vector<unsigned > address;
Vector<String> name;
String mapname;
void LoadMap(String fn)
{
String fpos = GetFileName(fn);
int dp = fpos.Find('.');
if(dp >= 0)
fpos.Trim(dp);
fn = AppendFileName(GetFileDirectory(fn), fpos) + ".map";
if(mapname == fn)
return;
mapname = fn;
address.Clear();
name.Clear();
String map = LoadFile(fn);
if(IsNull(map))
return;
const char *p = map;
while(*p)
if(*p++ == '\n' && !memcmp(p, " 0001:", 6)) {
p += 5;
while(IsXDigit(*++p))
;
while(*p == ' ')
p++;
const char *b = p;
while((byte)*p > ' ')
p++;
const char *e = p;
while(*p == ' ')
p++;
if(e > b && IsXDigit(*p)) {
unsigned addr = strtoul(p, 0, 16);
address.Add(addr);
name.Add(String(b, e));
}
}
IndexSort(address, name, StdLess<unsigned>());
}
String Fname(dword addr, bool& recognized) {
int pos = BinFindIndex(address, addr + 1) - 1;
String s;
s.Cat(Format("0x%08x", (int)addr));
if(pos >= 0) {
dword off = addr - address[pos];
if(off < 8000) {
s << ": ";
if(Imagehlp()) {
char nm[1024];
Imagehlp().UnDecorateSymbolName(name[pos], nm, 1024, UNDNAME_NO_ACCESS_SPECIFIERS|
UNDNAME_NO_MEMBER_TYPE|UNDNAME_NO_MS_KEYWORDS);
s << nm;
}
else
s << name[pos];
s << Format(" + 0x%x bytes", (int)off);
recognized = true;
return s;
}
}
s << " = " << Format("%d [%d, %d]", (int)addr, (int)LOWORD(addr), (int)HIWORD(addr));
recognized = false;
return s;
}
String LoadCrashFile(String filename)
{
LoadMap(filename);
FileIn in(filename);
String text;
text << "Crash log " << GetFileName(filename) << "\n";
if(name.GetCount() == 0)
text << "No mapfile found" << "\n";
dword version;
dword code, address;
int npar;
in % version;
in % code % address % npar;
Vector<dword> info;
Vector<dword> stack;
bool r;
int i;
while(npar--)
in % info.Add();
switch(code) {
case EXCEPTION_ACCESS_VIOLATION:
text << "Access violation ";
if(info.GetCount() >= 2)
text << (info[0] ? "writing" : "reading") << Format(" at 0x%08x", (int)info[1]);
break;
#define MEX(id) case id: text << #id; break;
MEX(EXCEPTION_DATATYPE_MISALIGNMENT)
MEX(EXCEPTION_BREAKPOINT)
MEX(EXCEPTION_SINGLE_STEP)
MEX(EXCEPTION_ARRAY_BOUNDS_EXCEEDED)
MEX(EXCEPTION_FLT_DENORMAL_OPERAND)
MEX(EXCEPTION_FLT_DIVIDE_BY_ZERO)
MEX(EXCEPTION_FLT_INEXACT_RESULT)
MEX(EXCEPTION_FLT_INVALID_OPERATION)
MEX(EXCEPTION_FLT_OVERFLOW)
MEX(EXCEPTION_FLT_STACK_CHECK)
MEX(EXCEPTION_FLT_UNDERFLOW)
MEX(EXCEPTION_INT_DIVIDE_BY_ZERO)
MEX(EXCEPTION_INT_OVERFLOW)
MEX(EXCEPTION_PRIV_INSTRUCTION)
MEX(EXCEPTION_IN_PAGE_ERROR)
MEX(EXCEPTION_ILLEGAL_INSTRUCTION)
MEX(EXCEPTION_NONCONTINUABLE_EXCEPTION)
MEX(EXCEPTION_STACK_OVERFLOW)
MEX(EXCEPTION_INVALID_DISPOSITION)
MEX(EXCEPTION_GUARD_PAGE)
MEX(EXCEPTION_INVALID_HANDLE)
default:
text << Format("Exception 0x%08x", (int)code);
}
text << '\n' << Fname(address, r) << '\n';
while(!in.IsEof())
in % stack.Add();
text << "\nRecognized stack dwords:\n";
for(i = 0; i < stack.GetCount(); i++) {
String s = Fname(stack[i], r);
if(r) text << "\t" << s << '\n';
}
text << "\nComplete stack:\n";
for(i = 0; i < stack.GetCount(); i++)
text << "\t" << Fname(stack[i], r) << '\n';
return text;
}
class CrashViewer : public TopWindow {
public:
typedef CrashViewer CLASSNAME;
CrashViewer();
void Run();
bool OpenFile();
virtual bool Key(dword key, int repcnt);
void LoadCrashFile();
private:
Splitter splitter;
ArrayCtrl crashfiles;
LineEdit crashdump;
};
CrashViewer::CrashViewer()
{
Sizeable().Zoomable();
splitter.Horz(crashfiles, crashdump);
splitter.SetPos(3000);
Add(splitter.SizePos());
crashfiles.AutoHideSb().NoHeader();
crashfiles.AddColumn();
crashfiles.WhenCursor = THISBACK(LoadCrashFile);
crashdump.SetFont(Courier(14));
}
void CrashViewer::Run()
{
if(!OpenFile())
return;
LoadCrashFile();
TopWindow::Run();
}
bool CrashViewer::Key(dword key, int repcnt)
{
if(key == K_CTRL_O) {
OpenFile();
return true;
}
return TopWindow::Key(key, repcnt);
}
bool CrashViewer::OpenFile()
{
FileSelector fs;
LoadFromFile(fs);
fs.Type("Crash file", "*.crash");
fs.DefaultExt("crash");
fs.Multi();
if(!fs.ExecuteOpen()) return false;
StoreToFile(fs);
int newln = -1;
for(int i = 0; i < fs.GetCount(); i++) {
String path = fs[i];
int f = crashfiles.Find(path);
if(f < 0) {
newln = crashfiles.GetCount();
crashfiles.Add(path);
}
}
if(newln >= 0)
crashfiles.SetCursor(newln);
return true;
}
void CrashViewer::LoadCrashFile()
{
String fn = Null;
if(crashfiles.IsCursor())
fn = crashfiles.Get(0);
String title = fn;
if(!IsNull(title))
title << " - crash analyzer";
else
title << "Crash analyzer";
Title(title);
if(IsNull(fn))
crashdump <<= Null;
else
crashdump <<= ::LoadCrashFile(fn);
}
GUI_APP_MAIN
{
SetDefaultCharset(CHARSET_WIN1250);
CrashViewer viewer;
viewer.Run();
/*
FileSelector fs;
LoadFromFile(fs);
fs.Type("Crash file", "*.crash");
if(!fs.ExecuteOpen()) return;
String text = LoadCrashFile(~fs);
TopWindow win;
win.Title("Crash analyzer - " + ~fs).Sizeable().Zoomable();
win.Icon(Image::Icon(100, true), Image::Icon(100, false));
LineEdit edit;
edit.SetFont(Courier(14));
edit <<= text;
win.Add(edit.SizePos());
win.Run();
*/
// StoreToFile(fs);
}

View file

Before

Width:  |  Height:  |  Size: 974 B

After

Width:  |  Height:  |  Size: 974 B

Before After
Before After

View file

@ -1,14 +1,14 @@
PREMULTIPLIED
IMAGE_ID(app_large)
IMAGE_ID(app_small)
IMAGE_BEGIN_DATA
IMAGE_DATA(120,156,229,150,91,14,132,48,8,69,89,194,44,193,165,186,115,102,162,153,153,22,41,143,66,91,19,49,124,244,193,61)
IMAGE_DATA(183,24,83,97,131,13,162,177,3,96,153,97,65,39,79,203,85,220,76,31,81,118,175,135,44,110,143,143,81,108,171,135)
IMAGE_DATA(149,252,209,108,201,195,44,118,203,195,74,254,108,54,245,240,100,126,57,70,60,147,142,203,57,109,141,211,224,106,189,115)
IMAGE_DATA(146,230,119,156,197,178,156,81,242,57,227,252,52,91,181,220,222,81,253,143,188,19,173,119,214,247,239,237,63,192,179,191)
IMAGE_DATA(255,59,240,87,120,0,18,171,249,51,61,112,236,89,30,36,246,29,248,35,61,88,216,35,124,120,185,153,30,34,236,136)
IMAGE_DATA(143,44,174,213,79,183,208,235,243,40,17,61,76,70,125,175,198,113,217,58,234,233,190,223,133,78,214,208,144,103,61,179)
IMAGE_DATA(70,52,43,93,186,118,140,1,46,63,80,194,153,254,251,160,145,214,122,100,180,116,15,151,61,149,134,163,190,234,35,214)
IMAGE_DATA(222,53,141,86,95,105,111,133,122,147,47,134,37,133,135,231,169,247,106,176,241,6,223,11,189,79,0,0,0,0,0,0)
IMAGE_END_DATA(256, 2)
PREMULTIPLIED
IMAGE_ID(app_large)
IMAGE_ID(app_small)
IMAGE_BEGIN_DATA
IMAGE_DATA(120,156,229,150,91,14,132,48,8,69,89,194,44,193,165,186,115,102,162,153,153,22,41,143,66,91,19,49,124,244,193,61)
IMAGE_DATA(183,24,83,97,131,13,162,177,3,96,153,97,65,39,79,203,85,220,76,31,81,118,175,135,44,110,143,143,81,108,171,135)
IMAGE_DATA(149,252,209,108,201,195,44,118,203,195,74,254,108,54,245,240,100,126,57,70,60,147,142,203,57,109,141,211,224,106,189,115)
IMAGE_DATA(146,230,119,156,197,178,156,81,242,57,227,252,52,91,181,220,222,81,253,143,188,19,173,119,214,247,239,237,63,192,179,191)
IMAGE_DATA(255,59,240,87,120,0,18,171,249,51,61,112,236,89,30,36,246,29,248,35,61,88,216,35,124,120,185,153,30,34,236,136)
IMAGE_DATA(143,44,174,213,79,183,208,235,243,40,17,61,76,70,125,175,198,113,217,58,234,233,190,223,133,78,214,208,144,103,61,179)
IMAGE_DATA(70,52,43,93,186,118,140,1,46,63,80,194,153,254,251,160,145,214,122,100,180,116,15,151,61,149,134,163,190,234,35,214)
IMAGE_DATA(222,53,141,86,95,105,111,133,122,147,47,134,37,133,135,231,169,247,106,176,241,6,223,11,189,79,0,0,0,0,0,0)
IMAGE_END_DATA(256, 2)

View file

@ -1,313 +1,313 @@
# Microsoft Developer Studio Generated NMAKE File, Based on crash.dsp
!IF "$(CFG)" == ""
CFG=crash - Win32 Debug
!MESSAGE No configuration specified. Defaulting to crash - Win32 Debug.
!ENDIF
!IF "$(CFG)" != "crash - Win32 Release" && "$(CFG)" != "crash - Win32 Debug"
!MESSAGE Invalid configuration "$(CFG)" specified.
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "crash.mak" CFG="crash - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "crash - Win32 Release" (based on "Win32 (x86) Application")
!MESSAGE "crash - Win32 Debug" (based on "Win32 (x86) Application")
!MESSAGE
!ERROR An invalid configuration is specified.
!ENDIF
!IF "$(OS)" == "Windows_NT"
NULL=
!ELSE
NULL=nul
!ENDIF
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "crash - Win32 Release"
OUTDIR=.\Release
INTDIR=.\Release
!IF "$(RECURSE)" == "0"
ALL : "c:\tools\crash.exe"
!ELSE
ALL : "VLib - Win32 Release" "tlib - Win32 Release" "tgui - Win32 Release" "CtrlLib - Win32 Release" "c:\tools\crash.exe"
!ENDIF
!IF "$(RECURSE)" == "1"
CLEAN :"CtrlLib - Win32 ReleaseCLEAN" "tgui - Win32 ReleaseCLEAN" "tlib - Win32 ReleaseCLEAN" "VLib - Win32 ReleaseCLEAN"
!ELSE
CLEAN :
!ENDIF
-@erase "$(INTDIR)\crash.obj"
-@erase "$(INTDIR)\crash.res"
-@erase "$(INTDIR)\vc60.idb"
-@erase "c:\tools\crash.exe"
"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
CPP_PROJ=/nologo /MT /W3 /GR /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /Fp"$(INTDIR)\crash.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32
RSC_PROJ=/l 0x405 /fo"$(INTDIR)\crash.res" /d "NDEBUG"
BSC32=bscmake.exe
BSC32_FLAGS=/nologo /o"$(OUTDIR)\crash.bsc"
BSC32_SBRS= \
LINK32=link.exe
LINK32_FLAGS=/nologo /subsystem:windows /incremental:no /pdb:"$(OUTDIR)\crash.pdb" /machine:I386 /out:"c:/tools/crash.exe"
LINK32_OBJS= \
"$(INTDIR)\crash.obj" \
"$(INTDIR)\crash.res" \
"..\CtrlLib\Release\CtrlLib.lib" \
"E:\build\tgui\Release\tgui.lib" \
"E:\build\tlib\Release\tlib.lib" \
"..\VLib\Release\VLib.lib"
"c:\tools\crash.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
!ELSEIF "$(CFG)" == "crash - Win32 Debug"
OUTDIR=.\Debug
INTDIR=.\Debug
# Begin Custom Macros
OutDir=.\Debug
# End Custom Macros
!IF "$(RECURSE)" == "0"
ALL : "$(OUTDIR)\crash.exe"
!ELSE
ALL : "VLib - Win32 Debug" "tlib - Win32 Debug" "tgui - Win32 Debug" "CtrlLib - Win32 Debug" "$(OUTDIR)\crash.exe"
!ENDIF
!IF "$(RECURSE)" == "1"
CLEAN :"CtrlLib - Win32 DebugCLEAN" "tgui - Win32 DebugCLEAN" "tlib - Win32 DebugCLEAN" "VLib - Win32 DebugCLEAN"
!ELSE
CLEAN :
!ENDIF
-@erase "$(INTDIR)\crash.obj"
-@erase "$(INTDIR)\crash.res"
-@erase "$(INTDIR)\vc60.idb"
-@erase "$(INTDIR)\vc60.pdb"
-@erase "$(OUTDIR)\crash.exe"
-@erase "$(OUTDIR)\crash.ilk"
-@erase "$(OUTDIR)\crash.pdb"
"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
CPP_PROJ=/nologo /MTd /W3 /Gm /GR /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /Fp"$(INTDIR)\crash.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c
MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32
RSC_PROJ=/l 0x405 /fo"$(INTDIR)\crash.res" /d "_DEBUG"
BSC32=bscmake.exe
BSC32_FLAGS=/nologo /o"$(OUTDIR)\crash.bsc"
BSC32_SBRS= \
LINK32=link.exe
LINK32_FLAGS=/nologo /subsystem:windows /incremental:yes /pdb:"$(OUTDIR)\crash.pdb" /debug /machine:I386 /out:"$(OUTDIR)\crash.exe" /pdbtype:sept
LINK32_OBJS= \
"$(INTDIR)\crash.obj" \
"$(INTDIR)\crash.res" \
"..\CtrlLib\Debug\CtrlLib.lib" \
"E:\build\tgui\Debug\tgui.lib" \
"E:\build\tlib\Debug\tlib.lib" \
"..\VLib\Debug\VLib.lib"
"$(OUTDIR)\crash.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
!ENDIF
.c{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.c{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
!IF "$(NO_EXTERNAL_DEPS)" != "1"
!IF EXISTS("crash.dep")
!INCLUDE "crash.dep"
!ELSE
!MESSAGE Warning: cannot find "crash.dep"
!ENDIF
!ENDIF
!IF "$(CFG)" == "crash - Win32 Release" || "$(CFG)" == "crash - Win32 Debug"
SOURCE=.\crash.cpp
"$(INTDIR)\crash.obj" : $(SOURCE) "$(INTDIR)"
SOURCE=.\crash.rc
"$(INTDIR)\crash.res" : $(SOURCE) "$(INTDIR)"
$(RSC) $(RSC_PROJ) $(SOURCE)
!IF "$(CFG)" == "crash - Win32 Release"
"CtrlLib - Win32 Release" :
cd "\SOURCE\CtrlLib"
$(MAKE) /$(MAKEFLAGS) /F .\CtrlLib.mak CFG="CtrlLib - Win32 Release"
cd "..\crash"
"CtrlLib - Win32 ReleaseCLEAN" :
cd "\SOURCE\CtrlLib"
$(MAKE) /$(MAKEFLAGS) /F .\CtrlLib.mak CFG="CtrlLib - Win32 Release" RECURSE=1 CLEAN
cd "..\crash"
!ELSEIF "$(CFG)" == "crash - Win32 Debug"
"CtrlLib - Win32 Debug" :
cd "\SOURCE\CtrlLib"
$(MAKE) /$(MAKEFLAGS) /F .\CtrlLib.mak CFG="CtrlLib - Win32 Debug"
cd "..\crash"
"CtrlLib - Win32 DebugCLEAN" :
cd "\SOURCE\CtrlLib"
$(MAKE) /$(MAKEFLAGS) /F .\CtrlLib.mak CFG="CtrlLib - Win32 Debug" RECURSE=1 CLEAN
cd "..\crash"
!ENDIF
!IF "$(CFG)" == "crash - Win32 Release"
"tgui - Win32 Release" :
E:
cd "E:\V\TLIB"
$(MAKE) /$(MAKEFLAGS) /F .\tgui.mak CFG="tgui - Win32 Release"
F:
cd "F:\SOURCE\crash"
"tgui - Win32 ReleaseCLEAN" :
E:
cd "E:\V\TLIB"
$(MAKE) /$(MAKEFLAGS) /F .\tgui.mak CFG="tgui - Win32 Release" RECURSE=1 CLEAN
F:
cd "F:\SOURCE\crash"
!ELSEIF "$(CFG)" == "crash - Win32 Debug"
"tgui - Win32 Debug" :
E:
cd "E:\V\TLIB"
$(MAKE) /$(MAKEFLAGS) /F .\tgui.mak CFG="tgui - Win32 Debug"
F:
cd "F:\SOURCE\crash"
"tgui - Win32 DebugCLEAN" :
E:
cd "E:\V\TLIB"
$(MAKE) /$(MAKEFLAGS) /F .\tgui.mak CFG="tgui - Win32 Debug" RECURSE=1 CLEAN
F:
cd "F:\SOURCE\crash"
!ENDIF
!IF "$(CFG)" == "crash - Win32 Release"
"tlib - Win32 Release" :
E:
cd "E:\V\TLIB"
$(MAKE) /$(MAKEFLAGS) /F .\tlib.mak CFG="tlib - Win32 Release"
F:
cd "F:\SOURCE\crash"
"tlib - Win32 ReleaseCLEAN" :
E:
cd "E:\V\TLIB"
$(MAKE) /$(MAKEFLAGS) /F .\tlib.mak CFG="tlib - Win32 Release" RECURSE=1 CLEAN
F:
cd "F:\SOURCE\crash"
!ELSEIF "$(CFG)" == "crash - Win32 Debug"
"tlib - Win32 Debug" :
E:
cd "E:\V\TLIB"
$(MAKE) /$(MAKEFLAGS) /F .\tlib.mak CFG="tlib - Win32 Debug"
F:
cd "F:\SOURCE\crash"
"tlib - Win32 DebugCLEAN" :
E:
cd "E:\V\TLIB"
$(MAKE) /$(MAKEFLAGS) /F .\tlib.mak CFG="tlib - Win32 Debug" RECURSE=1 CLEAN
F:
cd "F:\SOURCE\crash"
!ENDIF
!IF "$(CFG)" == "crash - Win32 Release"
"VLib - Win32 Release" :
cd "\SOURCE\VLib"
$(MAKE) /$(MAKEFLAGS) /F .\VLib.mak CFG="VLib - Win32 Release"
cd "..\crash"
"VLib - Win32 ReleaseCLEAN" :
cd "\SOURCE\VLib"
$(MAKE) /$(MAKEFLAGS) /F .\VLib.mak CFG="VLib - Win32 Release" RECURSE=1 CLEAN
cd "..\crash"
!ELSEIF "$(CFG)" == "crash - Win32 Debug"
"VLib - Win32 Debug" :
cd "\SOURCE\VLib"
$(MAKE) /$(MAKEFLAGS) /F .\VLib.mak CFG="VLib - Win32 Debug"
cd "..\crash"
"VLib - Win32 DebugCLEAN" :
cd "\SOURCE\VLib"
$(MAKE) /$(MAKEFLAGS) /F .\VLib.mak CFG="VLib - Win32 Debug" RECURSE=1 CLEAN
cd "..\crash"
!ENDIF
!ENDIF
# Microsoft Developer Studio Generated NMAKE File, Based on crash.dsp
!IF "$(CFG)" == ""
CFG=crash - Win32 Debug
!MESSAGE No configuration specified. Defaulting to crash - Win32 Debug.
!ENDIF
!IF "$(CFG)" != "crash - Win32 Release" && "$(CFG)" != "crash - Win32 Debug"
!MESSAGE Invalid configuration "$(CFG)" specified.
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "crash.mak" CFG="crash - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "crash - Win32 Release" (based on "Win32 (x86) Application")
!MESSAGE "crash - Win32 Debug" (based on "Win32 (x86) Application")
!MESSAGE
!ERROR An invalid configuration is specified.
!ENDIF
!IF "$(OS)" == "Windows_NT"
NULL=
!ELSE
NULL=nul
!ENDIF
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "crash - Win32 Release"
OUTDIR=.\Release
INTDIR=.\Release
!IF "$(RECURSE)" == "0"
ALL : "c:\tools\crash.exe"
!ELSE
ALL : "VLib - Win32 Release" "tlib - Win32 Release" "tgui - Win32 Release" "CtrlLib - Win32 Release" "c:\tools\crash.exe"
!ENDIF
!IF "$(RECURSE)" == "1"
CLEAN :"CtrlLib - Win32 ReleaseCLEAN" "tgui - Win32 ReleaseCLEAN" "tlib - Win32 ReleaseCLEAN" "VLib - Win32 ReleaseCLEAN"
!ELSE
CLEAN :
!ENDIF
-@erase "$(INTDIR)\crash.obj"
-@erase "$(INTDIR)\crash.res"
-@erase "$(INTDIR)\vc60.idb"
-@erase "c:\tools\crash.exe"
"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
CPP_PROJ=/nologo /MT /W3 /GR /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /Fp"$(INTDIR)\crash.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32
RSC_PROJ=/l 0x405 /fo"$(INTDIR)\crash.res" /d "NDEBUG"
BSC32=bscmake.exe
BSC32_FLAGS=/nologo /o"$(OUTDIR)\crash.bsc"
BSC32_SBRS= \
LINK32=link.exe
LINK32_FLAGS=/nologo /subsystem:windows /incremental:no /pdb:"$(OUTDIR)\crash.pdb" /machine:I386 /out:"c:/tools/crash.exe"
LINK32_OBJS= \
"$(INTDIR)\crash.obj" \
"$(INTDIR)\crash.res" \
"..\CtrlLib\Release\CtrlLib.lib" \
"E:\build\tgui\Release\tgui.lib" \
"E:\build\tlib\Release\tlib.lib" \
"..\VLib\Release\VLib.lib"
"c:\tools\crash.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
!ELSEIF "$(CFG)" == "crash - Win32 Debug"
OUTDIR=.\Debug
INTDIR=.\Debug
# Begin Custom Macros
OutDir=.\Debug
# End Custom Macros
!IF "$(RECURSE)" == "0"
ALL : "$(OUTDIR)\crash.exe"
!ELSE
ALL : "VLib - Win32 Debug" "tlib - Win32 Debug" "tgui - Win32 Debug" "CtrlLib - Win32 Debug" "$(OUTDIR)\crash.exe"
!ENDIF
!IF "$(RECURSE)" == "1"
CLEAN :"CtrlLib - Win32 DebugCLEAN" "tgui - Win32 DebugCLEAN" "tlib - Win32 DebugCLEAN" "VLib - Win32 DebugCLEAN"
!ELSE
CLEAN :
!ENDIF
-@erase "$(INTDIR)\crash.obj"
-@erase "$(INTDIR)\crash.res"
-@erase "$(INTDIR)\vc60.idb"
-@erase "$(INTDIR)\vc60.pdb"
-@erase "$(OUTDIR)\crash.exe"
-@erase "$(OUTDIR)\crash.ilk"
-@erase "$(OUTDIR)\crash.pdb"
"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
CPP_PROJ=/nologo /MTd /W3 /Gm /GR /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /Fp"$(INTDIR)\crash.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c
MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32
RSC_PROJ=/l 0x405 /fo"$(INTDIR)\crash.res" /d "_DEBUG"
BSC32=bscmake.exe
BSC32_FLAGS=/nologo /o"$(OUTDIR)\crash.bsc"
BSC32_SBRS= \
LINK32=link.exe
LINK32_FLAGS=/nologo /subsystem:windows /incremental:yes /pdb:"$(OUTDIR)\crash.pdb" /debug /machine:I386 /out:"$(OUTDIR)\crash.exe" /pdbtype:sept
LINK32_OBJS= \
"$(INTDIR)\crash.obj" \
"$(INTDIR)\crash.res" \
"..\CtrlLib\Debug\CtrlLib.lib" \
"E:\build\tgui\Debug\tgui.lib" \
"E:\build\tlib\Debug\tlib.lib" \
"..\VLib\Debug\VLib.lib"
"$(OUTDIR)\crash.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
!ENDIF
.c{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.c{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
!IF "$(NO_EXTERNAL_DEPS)" != "1"
!IF EXISTS("crash.dep")
!INCLUDE "crash.dep"
!ELSE
!MESSAGE Warning: cannot find "crash.dep"
!ENDIF
!ENDIF
!IF "$(CFG)" == "crash - Win32 Release" || "$(CFG)" == "crash - Win32 Debug"
SOURCE=.\crash.cpp
"$(INTDIR)\crash.obj" : $(SOURCE) "$(INTDIR)"
SOURCE=.\crash.rc
"$(INTDIR)\crash.res" : $(SOURCE) "$(INTDIR)"
$(RSC) $(RSC_PROJ) $(SOURCE)
!IF "$(CFG)" == "crash - Win32 Release"
"CtrlLib - Win32 Release" :
cd "\SOURCE\CtrlLib"
$(MAKE) /$(MAKEFLAGS) /F .\CtrlLib.mak CFG="CtrlLib - Win32 Release"
cd "..\crash"
"CtrlLib - Win32 ReleaseCLEAN" :
cd "\SOURCE\CtrlLib"
$(MAKE) /$(MAKEFLAGS) /F .\CtrlLib.mak CFG="CtrlLib - Win32 Release" RECURSE=1 CLEAN
cd "..\crash"
!ELSEIF "$(CFG)" == "crash - Win32 Debug"
"CtrlLib - Win32 Debug" :
cd "\SOURCE\CtrlLib"
$(MAKE) /$(MAKEFLAGS) /F .\CtrlLib.mak CFG="CtrlLib - Win32 Debug"
cd "..\crash"
"CtrlLib - Win32 DebugCLEAN" :
cd "\SOURCE\CtrlLib"
$(MAKE) /$(MAKEFLAGS) /F .\CtrlLib.mak CFG="CtrlLib - Win32 Debug" RECURSE=1 CLEAN
cd "..\crash"
!ENDIF
!IF "$(CFG)" == "crash - Win32 Release"
"tgui - Win32 Release" :
E:
cd "E:\V\TLIB"
$(MAKE) /$(MAKEFLAGS) /F .\tgui.mak CFG="tgui - Win32 Release"
F:
cd "F:\SOURCE\crash"
"tgui - Win32 ReleaseCLEAN" :
E:
cd "E:\V\TLIB"
$(MAKE) /$(MAKEFLAGS) /F .\tgui.mak CFG="tgui - Win32 Release" RECURSE=1 CLEAN
F:
cd "F:\SOURCE\crash"
!ELSEIF "$(CFG)" == "crash - Win32 Debug"
"tgui - Win32 Debug" :
E:
cd "E:\V\TLIB"
$(MAKE) /$(MAKEFLAGS) /F .\tgui.mak CFG="tgui - Win32 Debug"
F:
cd "F:\SOURCE\crash"
"tgui - Win32 DebugCLEAN" :
E:
cd "E:\V\TLIB"
$(MAKE) /$(MAKEFLAGS) /F .\tgui.mak CFG="tgui - Win32 Debug" RECURSE=1 CLEAN
F:
cd "F:\SOURCE\crash"
!ENDIF
!IF "$(CFG)" == "crash - Win32 Release"
"tlib - Win32 Release" :
E:
cd "E:\V\TLIB"
$(MAKE) /$(MAKEFLAGS) /F .\tlib.mak CFG="tlib - Win32 Release"
F:
cd "F:\SOURCE\crash"
"tlib - Win32 ReleaseCLEAN" :
E:
cd "E:\V\TLIB"
$(MAKE) /$(MAKEFLAGS) /F .\tlib.mak CFG="tlib - Win32 Release" RECURSE=1 CLEAN
F:
cd "F:\SOURCE\crash"
!ELSEIF "$(CFG)" == "crash - Win32 Debug"
"tlib - Win32 Debug" :
E:
cd "E:\V\TLIB"
$(MAKE) /$(MAKEFLAGS) /F .\tlib.mak CFG="tlib - Win32 Debug"
F:
cd "F:\SOURCE\crash"
"tlib - Win32 DebugCLEAN" :
E:
cd "E:\V\TLIB"
$(MAKE) /$(MAKEFLAGS) /F .\tlib.mak CFG="tlib - Win32 Debug" RECURSE=1 CLEAN
F:
cd "F:\SOURCE\crash"
!ENDIF
!IF "$(CFG)" == "crash - Win32 Release"
"VLib - Win32 Release" :
cd "\SOURCE\VLib"
$(MAKE) /$(MAKEFLAGS) /F .\VLib.mak CFG="VLib - Win32 Release"
cd "..\crash"
"VLib - Win32 ReleaseCLEAN" :
cd "\SOURCE\VLib"
$(MAKE) /$(MAKEFLAGS) /F .\VLib.mak CFG="VLib - Win32 Release" RECURSE=1 CLEAN
cd "..\crash"
!ELSEIF "$(CFG)" == "crash - Win32 Debug"
"VLib - Win32 Debug" :
cd "\SOURCE\VLib"
$(MAKE) /$(MAKEFLAGS) /F .\VLib.mak CFG="VLib - Win32 Debug"
cd "..\crash"
"VLib - Win32 DebugCLEAN" :
cd "\SOURCE\VLib"
$(MAKE) /$(MAKEFLAGS) /F .\VLib.mak CFG="VLib - Win32 Debug" RECURSE=1 CLEAN
cd "..\crash"
!ENDIF
!ENDIF

View file

@ -1 +1 @@
100 ICON DISCARDABLE "crash.ico"
100 ICON DISCARDABLE "crash.ico"

View file

@ -1 +1 @@
FN_C(DWORD, __stdcall, UnDecorateSymbolName, (PCSTR dn, PSTR udn, DWORD len, DWORD Flags))
FN_C(DWORD, __stdcall, UnDecorateSymbolName, (PCSTR dn, PSTR udn, DWORD len, DWORD Flags))

View file

@ -49,12 +49,12 @@ CONSOLE_APP_MAIN
{
std::vector<std::string> d = c;
RTIMING("CoSort<string>");
CoSort(d.begin(), d.end(), StdLess<std::string>());
CoSort(SubRange(d.begin(), d.end()), StdLess<std::string>());
}
{
std::vector<std::string> d = c;
RTIMING("Sort<string>");
Sort(d.begin(), d.end(), StdLess<std::string>());
Sort(SubRange(d.begin(), d.end()), StdLess<std::string>());
}
}
}

View file

@ -0,0 +1,35 @@
#include <Core/Core.h>
using namespace Upp;
int EtalonCompare(const String& sa, const String& sb)
{
int q = memcmp(~sa, ~sb, min(sa.GetLength(), sb.GetLength()));
return q ? q : SgnCompare(sa.GetLength(), sb.GetLength());
}
CONSOLE_APP_MAIN
{
StdLogSetup(LOG_COUT|LOG_FILE);
int less = 0, equal = 0;
for(int pass = 0; pass < 4; pass++) {
LOG("======= Pass " << pass);
for(int q = 0; q < 10000000; q++) {
String x[2];
for(int ii = 0; ii < 2; ii++) {
int n = Random(pass & 1 ? 40 : 14);
for(int i = 0; i < n; i++)
x[ii].Cat(Random(pass & 2 ? Random(26) + 'A' : 2));
}
int r1 = EtalonCompare(x[0], x[1]);
int r2 = x[0].Compare(x[1]);
ASSERT(r1 == r2);
if(r1 < 0)
less++;
if(r1 == 0)
equal++;
}
LOG("Less: " << less << ", Equal: " << equal);
}
}

View file

@ -0,0 +1,9 @@
uses
Core;
file
StringCompare3.cpp;
mainconfig
"" = "";

View file

@ -3,7 +3,8 @@
using namespace Upp;
// http://isocpp.org/blog/2014/12/myths-3 6.1
// http://isocpp.org/blog/2014/12/myths-3
// section 6.1
CONSOLE_APP_MAIN
{