心胸决定格局,眼界决定境界...

Eclipse CDT 导入 Makefile 构建的 C/C++ 工程

Eclipse CDT 导入 Makefile 构建的 C/C++ 工程

  1. File -> New -> Makefile Project with Existing Code
  2. 选择源码目录,语言选择C语言。如果是 Linux 环境,则选中 Linux GCC,Mac 环境则选择 MacOSX GCC,Windows 下用 Eclipse 则可以选择 MinGW GCC。
  3. Project -> Make Target -> Create,建立 all 和 clean 两个 Targets。
  4. 在 Make Target 的 View 里面选择刚刚建立的项目的 all 来构建项目
  5. 构建结束后,Run -> Debug As -> Local C/C++ Application -> gdb/mi,调试选项可以在 Debug Configuration 中设置。

其中 gdb/mi 和 gdb 的区别,在网上搜来如下解释:

gdb and gdb/mi are essentially the same, except that gdb/mi lets you
select the MI protocol version and command set to use (MI - or Machine 
Interface - is how Eclipse communicates with gdb, rather than using 
the normal gdb command-line interface). This is useful if you want to 
do something not supported by the defaults, or have a non-standard gdb,
such as used on Mac OS X. gdbserver is a very lightweight debug server
used for debugging embedded systems. **The normal gdb/mi commands are 
used, but gdb must be told to connect to a gdbserver running on a remote 
system.** There's an extra tab for specifying this information.

Reference:

  1. http://dev.eclipse.org/mhonarc/lists/photran/msg00926.html
  2. http://blog.csdn.net/kevin_zqw/article/details/6927151

-

posted @ 2014-11-13 11:37  WELEN  阅读(991)  评论(0)    收藏  举报