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

快乐虾

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++才对!

局部变量:

模块窗口:

??“人”的结构就是相互支撑,“众”人的事业需要每个人的参与。

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

相关文章:

你感兴趣的文章:

标签云: