您的位置:首页 > 运维架构 > Linux

Vs2013在Linux开发中的应用(22):模块加载

2014-12-25 21:27 351 查看
快乐虾http://blog.csdn.net/lights_joy/欢迎转载,但请保留作者信息

当gdb检测到模块的加载时会输出:=library-loaded,id="/lib/ld-linux.so.2",target-name="/lib/ld-linux.so.2",host-name="/lib/ld-linux.so.2",symbols-loaded="0",thread-group="i1"
在这里只给出了模块的名称,但VS除了要提供模块名称外还需要id,因而需要自己添加,无非就是个整数,只要不重复就可以了。
然后发送事件通知SDM:
privatevoid SendModuleLoaded(AD7Module ad7Module)
{
AD7ModuleLoadEvent eventObject = new AD7ModuleLoadEvent(ad7Module, true /*this is a module load */);
// TODO: Bind breakpoints when the module loads
Send(eventObject,AD7ModuleLoadEvent.IID, null);
}
然后就可以在输出窗口看到模块加载信息了:



当程序中断时,可以查询更详细的信息,此时SDM将调用: // Gets the MODULE_INFO that describes this module.
// This is how the debugger obtains most of theinformation about the module.
intIDebugModule2.GetInfo(enum_MODULE_INFO_FIELDS dwFields, MODULE_INFO[] infoArray) {
在这里根据要求填上infoArray的值,然后就可以看到模块窗口的信息了:

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: