PROJECT: removed crash dumper

GUI: fixed a problem with freeing the breakpoint parameters
This commit is contained in:
mr.exodia 2014-02-18 20:03:16 +01:00
parent 4a145fbcff
commit a59d7cbc36
13 changed files with 8 additions and 285 deletions

View File

@ -7,8 +7,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "x64_dbg_exe", "x64_dbg_exe\
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "x64_dbg_dbg", "x64_dbg_dbg\x64_dbg_dbg.vcxproj", "{E6548308-401E-3A8A-5819-905DB90522A6}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "x64_dbg_crash", "x64_dbg_crash\x64_dbg_crash.vcxproj", "{E28BFD48-D02F-9A8A-154D-21E1B221AD2F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Release|Win32 = Release|Win32
@ -27,10 +25,6 @@ Global
{E6548308-401E-3A8A-5819-905DB90522A6}.Release|Win32.Build.0 = Release|Win32
{E6548308-401E-3A8A-5819-905DB90522A6}.Release|x64.ActiveCfg = Release|x64
{E6548308-401E-3A8A-5819-905DB90522A6}.Release|x64.Build.0 = Release|x64
{E28BFD48-D02F-9A8A-154D-21E1B221AD2F}.Release|Win32.ActiveCfg = Release|Win32
{E28BFD48-D02F-9A8A-154D-21E1B221AD2F}.Release|Win32.Build.0 = Release|Win32
{E28BFD48-D02F-9A8A-154D-21E1B221AD2F}.Release|x64.ActiveCfg = Release|x64
{E28BFD48-D02F-9A8A-154D-21E1B221AD2F}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@ -2,7 +2,6 @@
<CodeBlocks_workspace_file>
<Workspace title="x64_dbg">
<Project filename="x64_dbg_bridge/x64_dbg_bridge.cbp" />
<Project filename="x64_dbg_crash/x64_dbg_crash.cbp" />
<Project filename="x64_dbg_dbg/x64_dbg_dbg.cbp" />
<Project filename="x64_dbg_exe/x64_dbg_exe.cbp" />
</Workspace>

View File

@ -1,57 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6" />
<Project>
<Option title="x64_dbg_crash" />
<Option pch_mode="2" />
<Option compiler="gcc" />
<Build>
<Target title="x32">
<Option output="../bin/x32/x32_crash" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="1" extension_auto="1" />
<Option object_output="obj/x32" />
<Option type="3" />
<Option compiler="gcc" />
<Option host_application="../bin/x32/x32_dbg.exe" />
<Option run_host_application_in_terminal="0" />
<Option createStaticLib="1" />
<Compiler>
<Add option="-O2" />
</Compiler>
<Linker>
<Add option="-s" />
<Add library="..\x64_dbg_dbg\dbghelp\dbghelp_x86.a" />
</Linker>
</Target>
<Target title="x64">
<Option output="../bin/x64/x64_crash" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="1" extension_auto="1" />
<Option object_output="obj/x64" />
<Option type="3" />
<Option compiler="gnu_gcc_compiler_x64" />
<Option host_application="../bin/x64/x64_dbg.exe" />
<Option run_host_application_in_terminal="0" />
<Option createStaticLib="1" />
<Compiler>
<Add option="-O2" />
</Compiler>
<Linker>
<Add option="-s" />
<Add library="..\x64_dbg_dbg\dbghelp\dbghelp_x64.a" />
</Linker>
</Target>
</Build>
<Compiler>
<Add option="-Wall" />
<Add option="-fexceptions" />
</Compiler>
<Linker>
<Add option="-static" />
</Linker>
<Unit filename="x64_dbg_crash.cpp" />
<Unit filename="x64_dbg_crash.h" />
<Extensions>
<code_completion />
<envvars />
<debugger />
</Extensions>
</Project>
</CodeBlocks_project_file>

View File

@ -1,75 +0,0 @@
#define _WIN32_WINNT 0x0500
#include <stdio.h>
#include <windows.h>
#include "x64_dbg_crash.h"
#include "..\x64_dbg_dbg\dbghelp\dbghelp.h"
static char szDumpPath[MAX_PATH]="";
static LONG WINAPI UnhandledException(EXCEPTION_POINTERS* pExceptionPointers)
{
unsigned int ExceptionCode=pExceptionPointers->ExceptionRecord->ExceptionCode;
if(ExceptionCode==0x40010006)
return EXCEPTION_EXECUTE_HANDLER;
char szFileName[MAX_PATH];
#ifdef _WIN64
const char* szAppName = "x64_dbg";
#else
const char* szAppName = "x32_dbg";
#endif //_WIN64
HANDLE hDumpFile;
SYSTEMTIME stLocalTime;
MINIDUMP_EXCEPTION_INFORMATION ExpParam;
GetLocalTime( &stLocalTime );
CreateDirectoryA(szDumpPath, 0);
sprintf(szFileName, "%s\\%s-%04d%02d%02d-%02d%02d%02d-%ld-%ld.dmp",
szDumpPath, szAppName,
stLocalTime.wYear, stLocalTime.wMonth, stLocalTime.wDay,
stLocalTime.wHour, stLocalTime.wMinute, stLocalTime.wSecond,
GetCurrentProcessId(), GetCurrentThreadId());
hDumpFile = CreateFile(szFileName, GENERIC_READ|GENERIC_WRITE,
FILE_SHARE_WRITE|FILE_SHARE_READ, 0, CREATE_ALWAYS, 0, 0);
ExpParam.ThreadId = GetCurrentThreadId();
ExpParam.ExceptionPointers = pExceptionPointers;
ExpParam.ClientPointers = TRUE;
MiniDumpWriteDump(GetCurrentProcess(), GetCurrentProcessId(),
hDumpFile, MiniDumpWithDataSegs, &ExpParam, NULL, NULL);
/*char szMessage[256]="";
sprintf(szMessage, "Exception code: 0x%.8X\n\nCrash dump written to:\n%s", ExceptionCode, szFileName);
MessageBoxA(0, szMessage, "Fatal Exception!", MB_ICONERROR|MB_SYSTEMMODAL);
ExitProcess(ExceptionCode);*/
return EXCEPTION_EXECUTE_HANDLER;
}
__declspec(dllexport) void InitCrashHandler() //dummy function
{
}
extern "C" __declspec(dllexport) BOOL APIENTRY DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
if(fdwReason==DLL_PROCESS_ATTACH)
{
int len=GetModuleFileNameA(hinstDLL, szDumpPath, MAX_PATH);
while(szDumpPath[len]!='\\' && len)
len--;
if(len)
szDumpPath[len]=0;
strcat(szDumpPath, "\\crashdumps");
AddVectoredExceptionHandler(0, UnhandledException);
}
return TRUE;
}

View File

@ -1,15 +0,0 @@
#ifndef _X64_DBG_CRASH_H
#define _X64_DBG_CRASH_H
#ifdef __cplusplus
extern "C"
{
#endif
__declspec(dllexport) void InitCrashHandler();
#ifdef __cplusplus
}
#endif
#endif //_X64_DBG_CRASH_H

View File

@ -1,86 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ClCompile Include="x64_dbg_crash.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="x64_dbg_crash.h" />
</ItemGroup>
<PropertyGroup Label="Globals">
<Keyword>Win32Proj</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)bin\x32</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
<TargetName>x32_crash</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)bin\x64</OutDir>
<TargetName>x64_crash</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;X64_DBG_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<TargetMachine>MachineX86</TargetMachine>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>$(SolutionDir)x64_dbg_dbg\dbghelp\dbghelp_x86.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;X64_DBG_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>$(SolutionDir)x64_dbg_dbg\dbghelp\dbghelp_x64.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -1,27 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="x64_dbg_crash.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="x64_dbg_crash.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>

View File

@ -1,3 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
</Project>

View File

@ -17,7 +17,6 @@
</Compiler>
<Linker>
<Add option="-s" />
<Add library="..\bin\x32\libx32_crash.a" />
<Add library="..\bin\x32\libx32_bridge.a" />
</Linker>
</Target>
@ -32,7 +31,6 @@
</Compiler>
<Linker>
<Add option="-s" />
<Add library="..\bin\x64\libx64_crash.a" />
<Add library="..\bin\x64\libx64_bridge.a" />
</Linker>
</Target>

View File

@ -6,7 +6,6 @@
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
{
InitCrashHandler();
const char* errormsg=BridgeInit();
if(errormsg)
{

View File

@ -65,7 +65,7 @@
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>$(SolutionDir)bin\x32\x32_crash.lib;$(SolutionDir)bin\x32\x32_bridge.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>$(SolutionDir)bin\x32\x32_bridge.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<ProgramDatabaseFile>$(TargetDir)$(TargetName)_exe.pdb</ProgramDatabaseFile>
</Link>
</ItemDefinitionGroup>
@ -81,7 +81,7 @@
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>$(SolutionDir)bin\x64\x64_crash.lib;$(SolutionDir)bin\x64\x64_bridge.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>$(SolutionDir)bin\x64\x64_bridge.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<ProgramDatabaseFile>$(TargetDir)$(TargetName)_exe.pdb</ProgramDatabaseFile>
</Link>
</ItemDefinitionGroup>

View File

@ -78,13 +78,6 @@ void SymbolView::moduleSelectionChanged(int index)
void SymbolView::updateSymbolList(int module_count, SYMBOLMODULEINFO* modules)
{
if(!module_count)
{
mModuleList->setRowCount(0);
mModuleList->reloadData();
this->moduleSelectionChanged(0);
return;
}
mModuleList->setRowCount(module_count);
for(int i=0; i<module_count; i++)
{

View File

@ -91,7 +91,8 @@ void BreakpointsView::reloadData()
mSoftBPTable->setCellContent(wI, 4, comment);
}
mHardBPTable->reloadData();
BridgeFree(wBPList.bp);
if(wBPList.count)
BridgeFree(wBPList.bp);
// Software
DbgGetBpList(bp_normal, &wBPList);
@ -122,7 +123,8 @@ void BreakpointsView::reloadData()
mSoftBPTable->setCellContent(wI, 4, comment);
}
mSoftBPTable->reloadData();
BridgeFree(wBPList.bp);
if(wBPList.count)
BridgeFree(wBPList.bp);
// Memory
DbgGetBpList(bp_memory, &wBPList);
@ -153,7 +155,8 @@ void BreakpointsView::reloadData()
mSoftBPTable->setCellContent(wI, 4, comment);
}
mMemBPTable->reloadData();
BridgeFree(wBPList.bp);
if(wBPList.count)
BridgeFree(wBPList.bp);
}