由于以后要在命令行下编译,因此无法一直在CoIDE下进行单步调试。
查看了一下CoIDE的目录发现ColinkEx的SW调试也是建立在gdbserver上,因此想到可以用gdb来调试指定的elf文件。尝试用arm-none-eabi-gdb.exe来remote ColinkEx的gdbserver可以连接并调试。
为了能在直观的调试,因此使用Eclipse,
环境搭建:
安装Zylin插件:Eclipse环境下help->Install New software, 并在work with选项中输入http://opensource.zylin.com/zylincdt 然后选择安装
调试配置:
Eclipse下Run->Debug Configurations,弹出配置框.在Zylin Embedded debug(Cygwin)下新建一个debug.
Main页下面,C/C++ Application中选择要调试的elf文件
Debugger页下面,GDB debugger选择,gdb所在位置
Commands页下面,在Init commands 加入远程连接命令“target remote 127.0.0.1:2009”, 端口号由ColinkEx启动gdbserver决定
开始调试:
执行CoIDE下C:\CooCox\CoIDE\bin的start_gdbserver.bat,启动gdbserver。
执行Eclipse下debug及可开始debug。