Microsoft(R) Debugging Tools for Windows(R)
DbgExts.dll DBGENG Sample Extension
README
Overview
This extension DLL shows how to write a debugger engine-style extension and
demonstrates use of a few APIs required by and provided to extension DLLs.
----------
Required and Optional Initialization
This mandatory routine must be implemented and exported for debugger engine
style extensions:
HRESULT
CALLBACK
DebugExtensionInitialize(PULONG Version, PULONG Flags)
This is called on loading of the extension DLL. Global variables and flags
for the extension should be initialized in this routine. One of the useful
things that is done in this routine is to initialize "ExtensionApis" as a
WINDBG_EXTENSION_APIS global variable from the lpExtensionApis parameter.
lpExtensionApis has pointers to some commonly used APIs for memory reads
and I/O.
This function should return the extension version in *Version. Flags is a
reserved parameter for future use and should be set to 0.
A debug session may not be active when the extension DLL is loaded so
initialization code here should not presume to be able to query for debug
session information.
All new dbgeng interface-style extensions can be identified by the
presence of the DebugExtensionInitialize export.
These next two routines are optional but it is recommended to implement these
routines in a debugger extension for better control of the debug session:
CALLBACK
DebugExtensionNotify(ULONG Notify, ULONG64 Argument)
This is used to notify the extension DLL of changes in debug session
states, e.g. when the session becomes accessible etc. Look at the
DEBUG_NOTIFY* definitions in dbgeng.h for argument values (active,
inactive, accessible, inaccessible).
Use of this function allows an extension to cache debug session related
info without needing to register explicit callbacks.
CALLBACK
DebugExtensionUninitialize(void)
This is called when a DLL is unloaded and can be used for cleanup related
code.
----------
Anatomy of an Extension Call
A debugger extension is a function with the following declared type:
HRESULT
CALLBACK
DebugExtensionCall(PDEBUG_CLIENT Client, PCSTR args)
Where "DebugExtensionCall" is an actual name of the extension being
implemented, such as "stack" for a !stack extension.
This is the recommended function prototype to use but, in reality,
extensions can use any prototype with one restriction - the function name
must begin with _EFN_ to distinguish the function as an extension function
some arbitrary, or normal, function. The debugger's
IDebugControl::GetExtensionFunction automatically prepends _EFN_ when
searching for the function in the extension DLL.
The Client parameter is the initial pointer to the debug engine's
IDebugClient interface.
The args parameter is simply the command line argument string passed to
the extension. It can be NULL or empty.
An extension can return DEBUG_EXTENSION_CONTINUE_SEARCH if the extension
cannot handle the request and in this case the debugger will search the
next path in the extension DLL chain.
In this sample, upon entering each extension, all required engine interfaces
are queried from the DEBUG_CLIENT using the INIT_API() macro. The same
interfaces are released using the EXIT_API() macro.
INIT_API() simply encapsulates a call to ExtQuery() and EXIT_API encapsulates
ExtRelease(). Any interfaces queried from the debugger engine should be
released before exit.
----------
Extensions Implemented in this Sample
cmdsample
This demonstrates use of engine APIs like IDebugControl::Execute, Output and
OutputStackTrace.
structsample
This shows how to read data from the target using helper definitions from the
wdbgexts.h header file. More importantly, it shows how to use types to read
values correctly so that the extension does not need to be rewritten when the
type definition changes for the target.
help
Extension DLLs should implement one extension called 'help' which shows
descriptions for the extension commands provided by the extension DLL.
没有合适的资源?快使用搜索试试~ 我知道了~
windbg(微软内核调试器)
共238个文件
dll:51个
h:39个
exe:34个
需积分: 16 14 下载量 86 浏览量
2009-03-15
21:49:48
上传
评论 1
收藏 14.5MB RAR 举报
温馨提示
windbg是windows内核调试器,可远程调控,也可本地调试 在http://www.microsoft.com/whdc/devtools/debugging/symbolpkg.mspx下载一个symbol可以,才能用。由于较大,需自己下载
资源推荐
资源详情
资源评论
收起资源包目录
windbg(微软内核调试器) (238个子文件)
exts.c 3KB
simple.c 1KB
placehold3.c 397B
placehold5.c 397B
placehold4.c 397B
placehold2.c 397B
placehold1.c 397B
1394dbg.cat 14KB
usb2dbg.cat 10KB
debugger.chi 301KB
debugger.chm 4.51MB
dbghelp.chm 409KB
ssindex.cmd 32KB
cv2http.cmd 838B
walk.cmd 343B
vssindex.cmd 188B
svnindex.cmd 188B
tfsindex.cmd 188B
cvsindex.cmd 188B
p4index.cmd 187B
engextcpp.cpp 110KB
healer.cpp 21KB
adp_ext.cpp 12KB
exts.cpp 11KB
remmon.cpp 9KB
assert.cpp 8KB
dbgexts.cpp 8KB
dumpstk.cpp 7KB
extcpp.cpp 4KB
extr.cpp 3KB
dbgexts.cpp 3KB
out.cpp 1KB
out.cpp 1KB
out.cpp 1KB
dbgexts.def 834B
simple.def 758B
extcpp.def 704B
adp_ext.def 310B
dirs 131B
dbgeng.dll 3.21MB
ext.dll 2.36MB
kdex2x86.dll 2.21MB
kdexts.dll 1.41MB
dbghelp.dll 1.02MB
dbghelp.dll 1.02MB
sos.dll 922KB
ks.dll 520KB
wdfkd.dll 508KB
wmitrace.dll 472KB
kdextx86.dll 461KB
kdextx86.dll 459KB
decem.dll 409KB
exts.dll 405KB
userkdx.dll 308KB
userkdx.dll 305KB
traceprt.dll 290KB
logexts.dll 282KB
kext.dll 206KB
gdikdx.dll 186KB
gdikdx.dll 184KB
userexts.dll 176KB
userexts.dll 175KB
rpcexts.dll 166KB
vdmexts.dll 160KB
symsrv.dll 128KB
symsrv.dll 128KB
fltkd.dll 124KB
acpikd.dll 116KB
vdmexts.dll 114KB
vdmexts.dll 113KB
acpikd.dll 112KB
uext.dll 103KB
ndiskd.dll 95KB
srcsrv.dll 94KB
srcsrv.dll 94KB
ntsdexts.dll 93KB
ntsdexts.dll 93KB
rpcexts.dll 88KB
rpcexts.dll 86KB
ntsdexts.dll 84KB
minipkd.dll 79KB
scsikd.dll 79KB
acpikd.dll 74KB
ndiskd.dll 50KB
ndiskd.dll 50KB
wow64exts.dll 42KB
symproxy.dll 34KB
scsikd.dll 33KB
scsikd.dll 33KB
symbolcheck.dll 33KB
kernel_debugging_tutorial.doc 1.14MB
themes.doc 538KB
symhttp.doc 271KB
srcsrv.doc 109KB
dml.doc 56KB
windbg.exe 512KB
pdbstr.exe 414KB
kd.exe 343KB
cdb.exe 331KB
ntsd.exe 331KB
共 238 条
- 1
- 2
- 3
资源评论
soslord
- 粉丝: 36
- 资源: 30
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功