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

来源:互联网 发布:mac苹果电脑备份 编辑:程序博客网 时间:2024/05/17 06:40

快乐虾

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的值,然后就可以看到模块窗口的信息了:

1 0
原创粉丝点击