Vs2013在Linux开发中的应用(25):曙光

来源:互联网 发布:延安广电网络商务宾馆 编辑:程序博客网 时间:2024/05/17 07:20

快乐虾

http://blog.csdn.net/lights_joy/

欢迎转载,但请保留作者信息

SDM接收到断点命中的消息时,它将停止调试过程,然后获取程序状态,第一个要做的就是线程列表:

        // EnumThreads is called by the debugger when it needs to enumerate the threads in the program.        public int EnumThreads(out IEnumDebugThreads2 ppEnum)

在此需要填充线程的所有信息,由于在检测到线程创建时已经保存了线程信息,这里直接填充就可以了。

紧接着要处理:

        // Retrieves a list of the stack frames for this thread.        // We currently call into the process and get the frames.  We might want to cache the frame info.        int IDebugThread2.EnumFrameInfo(enum_FRAMEINFO_FLAGS dwFieldSpec, uint nRadix, out IEnumDebugFrameInfo2 enumObject) {

这个可以使用gdb的命令完成:

-thread-select 1

^done,new-thread-id="1",frame={level="0",addr="0x0805fc75",func="main",args=[{name="argc",value="1"},{name="argv",value="0xbffff6e4"}],file="../../app/rc/rc.c",fullname="/mnt/hgfs/nvs_dev/src/ipc/app/rc/rc.c",line="1565"}

-stack-info-frame

^done,frame={level="0",addr="0x0805fc75",func="main",file="../../app/rc/rc.c",fullname="/mnt/hgfs/nvs_dev/src/ipc/app/rc/rc.c",line="1565"}

-stack-list-frames

^done,stack=[frame={level="0",addr="0x0805fc75",func="main",file="../../app/rc/rc.c",fullname="/mnt/hgfs/nvs_dev/src/ipc/app/rc/rc.c",line="1565"}]

至此,我们已经可以看到VS正确地在断点的位置停下来了:


看看调用堆栈:



似乎语言填得有点问题,应该是C/C++才对!

局部变量:


模块窗口:




0 0
原创粉丝点击