...
 
Commits (2)
......@@ -34,6 +34,7 @@ PROCESS_DEBUG_ID attachKernel( const std::wstring &connectOptions = L"" );
bool isDumpAnalyzing();
DumpType getDumpType();
DumpFormatFlagsSet getDumpFormat();
bool isKernelDebugging();
......
......@@ -250,6 +250,32 @@ enum DumpType
KernelFull = Full
};
enum DumpFormat
{
UserSmallFullMemory = 0x1,
UserSmallHandleData = 0x2,
UserSmallUnloadedModules = 0x4,
UserSmallIndirectMemory = 0x8,
UserSmallDataSegments = 0x10,
UserSmallFilterMemory = 0x20,
UserSmallFilterPaths = 0x40,
UserSmallProcessThreadData = 0x80,
UserSmallPrivateReadWriteMemory = 0x100,
UserSmallNoOptionalData = 0x200,
UserSmallFullMemoryInfo = 0x400,
UserSmallThreadInfo = 0x800,
UserSmallCodeSegments = 0x1000,
UserSmallNoAuxiliaryState = 0x2000,
UserSmallFullAuxiliaryState = 0x4000,
UserSmallModuleHeaders = 0x8000,
UserSmallFilterTriage = 0x10000,
UserSmallAddAvxXStateContext = 0x20000,
UserSmallIptTrace = 0x40000,
UserSmallIgnoreInaccessibleMem = 0x08000000
};
typedef unsigned long DumpFormatFlagsSet;
///////////////////////////////////////////////////////////////////////////////
} // kdlib namespace end
......
......@@ -535,6 +535,21 @@ DumpType getDumpType()
///////////////////////////////////////////////////////////////////////////////////
DumpFormatFlagsSet getDumpFormat()
{
HRESULT hres;
ULONG formatFlags;
hres = g_dbgMgr->control->GetDumpFormatFlags(&formatFlags);
if (FAILED(hres))
throw DbgEngException(L"IDebugControl::GetDumpFormatFlags", hres);
return formatFlags;
}
///////////////////////////////////////////////////////////////////////////////////
bool isKernelDebugging()
{
HRESULT hres;
......
#include <stdafx.h>
#include "procfixture.h"
#include "memdumpfixture.h"
#include "kdlib/dbgengine.h"
using namespace kdlib;
......@@ -26,3 +27,24 @@ TEST_F(DbgEngineTest, DbgCommandUnicode)
{
EXPECT_EQ(L"💩", kdlib::debugCommand(kdlib::debugCommand(L".printf \"💩\""), true));
}
class MiniDump : public MemDumpFixture
{
public:
MiniDump()
: MemDumpFixture(makeDumpFullName(MemDumps::MINIDUMP))
{
}
};
TEST_F(MiniDump, DumpType)
{
EXPECT_TRUE(isDumpAnalyzing());
EXPECT_EQ(DumpType::Small, getDumpType());
}
TEST_F(MiniDump, DumpFormat)
{
auto expected = DumpFormat::UserSmallFullMemoryInfo | DumpFormat::UserSmallUnloadedModules | DumpFormat::UserSmallHandleData;
EXPECT_EQ(expected, getDumpFormat());
}
......@@ -20,6 +20,7 @@ public:
static constexpr wchar_t* WIN10_ARM64 = L"win10_arm64_mem";
static constexpr wchar_t* WIN10_ARM = L"win10_arm_rpi3_mem";
static constexpr wchar_t* WIN8_X64 = L"win8_x64_mem";
static constexpr wchar_t* MINIDUMP = L"targetapp_minidump";
};
inline std::wstring makeDumpDirName(const wchar_t* dumpName)
......