...
 
Commits (2)
......@@ -33,6 +33,8 @@ bool isLocalKernelDebuggerEnabled();
PROCESS_DEBUG_ID attachKernel( const std::wstring &connectOptions = L"" );
bool isDumpAnalyzing();
DumpType getDumpType();
bool isKernelDebugging();
std::wstring debugCommand(const std::wstring &command, bool suppressOutput = false, const OutputFlagsSet& captureFlags = OutputFlag::Normal);
......
......@@ -239,6 +239,17 @@ enum OutputFlag
typedef unsigned long OutputFlagsSet;
enum DumpType
{
Small = 1024,
Default = 1025,
Full = 1026,
Image = 1027,
KernelSmall = Small,
Kernel = Default,
KernelFull = Full
};
///////////////////////////////////////////////////////////////////////////////
} // kdlib namespace end
......
......@@ -514,6 +514,27 @@ bool isDumpAnalyzing()
///////////////////////////////////////////////////////////////////////////////////
DumpType getDumpType()
{
HRESULT hres;
ULONG debugClass, debugQualifier;
hres = g_dbgMgr->control->GetDebuggeeType(&debugClass, &debugQualifier);
if (FAILED(hres))
throw DbgEngException(L"IDebugControl::GetDebuggeeType", hres);
if (debugQualifier < DEBUG_DUMP_SMALL)
throw DbgException("Target is not a dump");
if (debugQualifier > DEBUG_DUMP_IMAGE_FILE)
throw DbgException("Unsupported dump type");
return static_cast<DumpType>(debugQualifier);
}
///////////////////////////////////////////////////////////////////////////////////
bool isKernelDebugging()
{
HRESULT hres;
......
......@@ -89,3 +89,10 @@ TEST_F(ARM64KernelMiniDump, Test)
}
}
}
TEST_F(ARM64KernelMiniDump, DumpType)
{
EXPECT_TRUE(isDumpAnalyzing());
EXPECT_TRUE(isKernelDebugging());
EXPECT_EQ(DumpType::KernelSmall, getDumpType());
}
......@@ -78,3 +78,10 @@ TEST_F(ARMKernelMiniDump, Test)
}
}
TEST_F(ARMKernelMiniDump, DumpType)
{
EXPECT_TRUE(isDumpAnalyzing());
EXPECT_TRUE(isKernelDebugging());
EXPECT_EQ(DumpType::KernelSmall, getDumpType());
}