Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
kdlibcpp
kdlibcpp
Commits
0ace067c
Commit
0ace067c
authored
May 07, 2020
by
ussrhero
Browse files
added getDumpType function / DumpType enum
parent
178ec1ce
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
48 additions
and
0 deletions
+48
-0
kdlib/include/kdlib/dbgengine.h
kdlib/include/kdlib/dbgengine.h
+2
-0
kdlib/include/kdlib/dbgtypedef.h
kdlib/include/kdlib/dbgtypedef.h
+11
-0
kdlib/source/win/dbgeng.cpp
kdlib/source/win/dbgeng.cpp
+21
-0
kdlib/tests/kdlibtest/arm64dumptest.cpp
kdlib/tests/kdlibtest/arm64dumptest.cpp
+7
-0
kdlib/tests/kdlibtest/armdumptest.cpp
kdlib/tests/kdlibtest/armdumptest.cpp
+7
-0
No files found.
kdlib/include/kdlib/dbgengine.h
View file @
0ace067c
...
...
@@ -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
);
...
...
kdlib/include/kdlib/dbgtypedef.h
View file @
0ace067c
...
...
@@ -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
...
...
kdlib/source/win/dbgeng.cpp
View file @
0ace067c
...
...
@@ -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
;
...
...
kdlib/tests/kdlibtest/arm64dumptest.cpp
View file @
0ace067c
...
...
@@ -89,3 +89,10 @@ TEST_F(ARM64KernelMiniDump, Test)
}
}
}
TEST_F
(
ARM64KernelMiniDump
,
DumpType
)
{
EXPECT_TRUE
(
isDumpAnalyzing
());
EXPECT_TRUE
(
isKernelDebugging
());
EXPECT_EQ
(
DumpType
::
KernelSmall
,
getDumpType
());
}
kdlib/tests/kdlibtest/armdumptest.cpp
View file @
0ace067c
...
...
@@ -78,3 +78,10 @@ TEST_F(ARMKernelMiniDump, Test)
}
}
TEST_F
(
ARMKernelMiniDump
,
DumpType
)
{
EXPECT_TRUE
(
isDumpAnalyzing
());
EXPECT_TRUE
(
isKernelDebugging
());
EXPECT_EQ
(
DumpType
::
KernelSmall
,
getDumpType
());
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment