开发者

Debugging not possible in Eclipse

开发者 https://www.devze.com 2023-02-14 09:04 出处:网络
I tried to debug a C++ project in Eclipse Helios, last release. I set breakpoints in some non-main functions, but the debug function never stops there, and I get a warning message which says

I tried to debug a C++ project in Eclipse Helios, last release. I set breakpoints in some non-main functions, but the debug function never stops there, and I get a warning message which says

"breakpoint attribute problem installation failed"

What could be the reason?

PS: The same problem also happens with Eclipse Galileo, last release PS2: In the same conditions, I installed Ubuntu 9.10 in a virtual machine under parallels 5.0. The I installed Eclipse CDT Helios and did the same procedure. Now I do not get this error. My conclusion at this point is, either gdb from mac is fault susp开发者_如何学编程icious or eclipse for mac has problems in this aspect. As a workaround I am thinking about working in Eclipse for mac and setting up remote debugging so the compilation and gdbsrver run on the virtual linux machine, at least until somebody proposes a better solution.


Check if this bug report applies to your scenario: https://bugs.eclipse.org/bugs/show_bug.cgi?id=331833


I suffered from the same problem and solved it. Try to add "-g" option into the first line in "Makefile" file.


Using Eclipse Kepler on Mac OSX I found this works for debugging:

Before you start, you need to put the includes in usr/, so the files should be in /usr/includes. To do this you Start XCode and Choose Preference/Downloads/Command Line Tools (the top one). when you are finished, check to see the files are there. You may need to tell Eclipse where they are in the C++ Preferences.

  1. Create the C++ project.
  2. Choose Makefile Project near bottom of list.
  3. Choose Hello or Empty.
  4. On next screen it will give you only one compiler choice Mac, but you may choose later. This works with both the GCC C++ compiler and the LLVM with Clang.
  5. Compile the hello file or create your new project.
  6. If there are error messages, build the project anyway and run it. If this doesn't work, restart Eclipse and debugging should now work.

This seems pretty buggy. I may write my code in XCode and then transfer it to Eclipse to compile for different platforms.


You may have multiple levels of makefiles and one of them may not use the -g option. This was the case with me and by adding -g in the makefile which generates the final application solved this problem for me.


Sometimes the reason for this may be that the previous run of this application has not been terminated. Check the debug window to see if the icon "terminate" is red. If this occurs, click it to make it gray. After that, most likely you will be able to set a breakpoint.

0

精彩评论

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