Vs2013在Linux开发中的应用(25):曙光
2014-12-31 21:52
399 查看
快乐虾http://blog.csdn.net/lights_joy/欢迎转载,但请保留作者信息在SDM接收到断点命中的消息时,它将停止调试过程,然后获取程序状态,第一个要做的就是线程列表:
在此需要填充线程的所有信息,由于在检测到线程创建时已经保存了线程信息,这里直接填充就可以了。紧接着要处理:
这个可以使用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++才对!局部变量:
模块窗口:
// 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开发中的应用(19): 启动gdb
- Vs2013在Linux开发中的应用(34):Ctrl + F5支持
- Vs2013在Linux开发中的应用(19): 启动gdb
- Vs2013在Linux开发中的应用(17): 调试参数传递
- Linux应用开发入门
- 使用Java语言快速开发Linux GUI的应用
- Linux程序应用开发环境和工具经验谈
- 使用Pyqt在Linux下开发GUI桌面应用
- 中法合作开发 Linux 应用平台
- Linux串口应用开发
- 嵌入式Linux开发工具选择和应用分析
- Linux程序应用开发环境和工具经验谈
- Oracle应用Linux开发C
- 嵌入式linux应用开发之:初识Qt - farsight嵌入式学习专栏 - CSDNBlog
- Maemo Linux手机平台系列分析:(15) Maemo应用开发
- 用Gtk+开发Linux上的GUI应用软件
- 轻松进入Linux的桌面应用开发.gambas初步认识.
- 用Java快速开发Linux GUI应用
- 用Java快速开发Linux GUI应用
- 用Java快速开发Linux GUI应用-Java基础-Java-编程开发