[MiniDump] Added 2 new flags: "bigminidump" and "reallybigminidumps" that dump code segments and code + data segments respectively. tell the testers to use them

This commit is contained in:
TheApadayo 2017-02-06 15:51:46 -05:00
parent 8270040aab
commit a19c98dfca
4 changed files with 33 additions and 7 deletions

View File

@ -3,6 +3,7 @@
namespace Components
{
Utils::Hook Exception::SetFilterHook;
int Exception::MiniDumpType;
__declspec(noreturn) void Exception::ErrorLongJmp(jmp_buf _Buf, int _Value)
{
@ -23,7 +24,7 @@ namespace Components
return EXCEPTION_CONTINUE_EXECUTION;
}
auto minidump = MinidumpUpload::CreateQueuedMinidump(ExceptionInfo);
auto minidump = MinidumpUpload::CreateQueuedMinidump(ExceptionInfo, Exception::MiniDumpType);
if (!minidump)
{
OutputDebugStringA("Failed to create new minidump!");
@ -61,8 +62,34 @@ namespace Components
return SetUnhandledExceptionFilter(&Exception::ExceptionFilter);
}
void Exception::SetMiniDumpType()
{
Exception::MiniDumpType = MiniDumpIgnoreInaccessibleMemory;
Exception::MiniDumpType |= MiniDumpWithUnloadedModules;
Exception::MiniDumpType |= MiniDumpWithThreadInfo;
Exception::MiniDumpType |= MiniDumpWithFullMemoryInfo;
Exception::MiniDumpType |= MiniDumpWithHandleData;
Exception::MiniDumpType |= MiniDumpWithTokenInformation;
Exception::MiniDumpType |= MiniDumpWithProcessThreadData;
Exception::MiniDumpType |= MiniDumpWithFullAuxiliaryState;
if (Flags::HasFlag("bigminidumps"))
{
Exception::MiniDumpType |= MiniDumpWithModuleHeaders;
Exception::MiniDumpType |= MiniDumpWithCodeSegs;
}
else if (Flags::HasFlag("reallybigminidumps"))
{
Exception::MiniDumpType |= MiniDumpWithModuleHeaders;
Exception::MiniDumpType |= MiniDumpWithCodeSegs;
Exception::MiniDumpType |= MiniDumpWithDataSegs;
}
}
Exception::Exception()
{
SetMiniDumpType();
#ifdef DEBUG
// Display DEBUG branding, so we know we're on a debug build
Renderer::OnFrame([]()

View File

@ -13,6 +13,9 @@ namespace Components
#endif
static LPTOP_LEVEL_EXCEPTION_FILTER Hook();
static int MiniDumpType;
static void SetMiniDumpType();
private:
static LONG WINAPI ExceptionFilter(LPEXCEPTION_POINTERS ExceptionInfo);
static LPTOP_LEVEL_EXCEPTION_FILTER WINAPI SetUnhandledExceptionFilterStub(LPTOP_LEVEL_EXCEPTION_FILTER lpTopLevelExceptionFilter);

View File

@ -1,8 +1,6 @@
#include "STDInclude.hpp"
#include "Shlwapi.h"
const int MiniDumpTiny = MiniDumpIgnoreInaccessibleMemory | /*MiniDumpWithModuleHeaders |*/ MiniDumpWithUnloadedModules | MiniDumpWithThreadInfo | MiniDumpWithFullMemoryInfo | MiniDumpWithHandleData | MiniDumpWithTokenInformation | MiniDumpWithProcessThreadData | MiniDumpWithFullAuxiliaryState;
namespace Components
{

View File

@ -6,8 +6,6 @@
#pragma comment(lib, "dbghelp.lib")
#pragma warning(pop)
extern const int MiniDumpTiny;
namespace Components
{
// This class holds a Minidump and allows easy access to its aspects.
@ -16,7 +14,7 @@ namespace Components
public:
~Minidump();
static Minidump* Create(std::string path, LPEXCEPTION_POINTERS exceptionInfo, int type = MiniDumpTiny);
static Minidump* Create(std::string path, LPEXCEPTION_POINTERS exceptionInfo, int type);
static Minidump* Open(std::string path);
bool GetStream(MINIDUMP_STREAM_TYPE type, PMINIDUMP_DIRECTORY* directoryPtr, PVOID* streamPtr, ULONG* streamSizePtr);
bool Check();
@ -46,7 +44,7 @@ namespace Components
static bool Upload(Minidump* minidump);
// Generates a new minidump and saves it to the folder for queued minidumps.
static Minidump* CreateQueuedMinidump(LPEXCEPTION_POINTERS exceptionInfo, int minidumpType = MiniDumpTiny);
static Minidump* CreateQueuedMinidump(LPEXCEPTION_POINTERS exceptionInfo, int minidumpType);
// Browses the folder for queued minidumps and uploads each queued minidump.
// On Release builds this will also delete every successfully uploaded minidump.