Commit 0ace067c authored by ussrhero's avatar ussrhero
Browse files

added getDumpType function / DumpType enum

parent 178ec1ce
...@@ -33,6 +33,8 @@ bool isLocalKernelDebuggerEnabled(); ...@@ -33,6 +33,8 @@ bool isLocalKernelDebuggerEnabled();
PROCESS_DEBUG_ID attachKernel( const std::wstring &connectOptions = L"" ); PROCESS_DEBUG_ID attachKernel( const std::wstring &connectOptions = L"" );
bool isDumpAnalyzing(); bool isDumpAnalyzing();
DumpType getDumpType();
bool isKernelDebugging(); bool isKernelDebugging();
std::wstring debugCommand(const std::wstring &command, bool suppressOutput = false, const OutputFlagsSet& captureFlags = OutputFlag::Normal); std::wstring debugCommand(const std::wstring &command, bool suppressOutput = false, const OutputFlagsSet& captureFlags = OutputFlag::Normal);
......
...@@ -239,6 +239,17 @@ enum OutputFlag ...@@ -239,6 +239,17 @@ enum OutputFlag
typedef unsigned long OutputFlagsSet; typedef unsigned long OutputFlagsSet;
enum DumpType
{
Small = 1024,
Default = 1025,
Full = 1026,
Image = 1027,
KernelSmall = Small,
Kernel = Default,
KernelFull = Full
};
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
} // kdlib namespace end } // kdlib namespace end
......
...@@ -514,6 +514,27 @@ bool isDumpAnalyzing() ...@@ -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() bool isKernelDebugging()
{ {
HRESULT hres; HRESULT hres;
......
...@@ -89,3 +89,10 @@ TEST_F(ARM64KernelMiniDump, Test) ...@@ -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) ...@@ -78,3 +78,10 @@ TEST_F(ARMKernelMiniDump, Test)
} }
} }
TEST_F(ARMKernelMiniDump, DumpType)
{
EXPECT_TRUE(isDumpAnalyzing());
EXPECT_TRUE(isKernelDebugging());
EXPECT_EQ(DumpType::KernelSmall, getDumpType());
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment