开发者

How can I debug a C++ executable compiled externally (with debug flags set) from inside Eclipse?

开发者 https://www.devze.com 2023-04-11 10:14 出处:网络
I have a large C++ project, different parts of which are compiled in different ways (bjam/make). I was having trouble getting it to build from within Eclip开发者_JS百科se. Could I build the code exter

I have a large C++ project, different parts of which are compiled in different ways (bjam/make). I was having trouble getting it to build from within Eclip开发者_JS百科se. Could I build the code externally (with g++ -g), and then just run the debugger from within Eclipse?


I figured it out. Should've looked earlier at this: http://wiki.eclipse.org/CDT/User/FAQ#Debugging_C.2FC.2B.2B_Projects

I first added my project to eclipse. Then I followed the instructions above to set up a debug configuration. And somewhat surprisingly eclipse is able to figure out that the binary I want to run refers to the project that I have open, and so I can actually set breakpoints, step through the code while eclipse shows me which line in which file I'm at, etc. So its exactly as if I built the project from within eclipse. Its impressive :)

0

精彩评论

暂无评论...
验证码 换一张
取 消