Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » Debugging Issues(Build and run OK, but debug not working)
icon9.gif  Debugging Issues [message #758123] Mon, 21 November 2011 19:37 Go to next message
Eclipse UserFriend
Hello everyone,

I am running Eclipse Indigo on Mac 10.5.8. I have experimented with several C projects but cannot get any 'sophisticated' project into debug mode.

If I make a basic Hello World and auto-generate a makefile, then debug (and breakpoints) works. However, if I write my own makefile (same HelloWorld.c) then build and run both execute fine, but not debug mode. It compiles and runs in Mac Terminal. But in Eclipse, the breakpoints are ignored ("blue dots" become "yellow triangles" as breakpoint icons).

This is consistent with the same basic Hello World example as well as my thesis research involving many more subroutines. I don't think it is some incorrect permutation of Eclipse's options (binary/error parsers (I've used Mach-O 64 and/or Elf), or toolchain (I've used Cross GCC or MacOSC GCC with gcc/cc w/wo -WO3), or compiler (/usr/vacpp/bin) etc, but I'm not even sure which is the correct choice of parsers/toolchain?). Interestingly I have encounter this same problem of mine with Netbeans.

Under my projects' debug configurations, I use /usr/bin/gdb (also have /usr/bin/gdb-6.8/gdb) and have tried various combinations of my /.gdbinit file including:

directory /projects/micromanager/
directory /projects/micromanager/MMCore
directory /projects/micromanager/MMDevice
directory /projects/micromanager/DeviceAdapters/DemoCamera

and the latest from reverse.put.as/gdbinit/. My Debug Configuration -- Environment is blank.

Finally, I noticed that when the debug mode works for the auto-generated (default) makefile, the icons for the binary files are little bugs, whereas the icons for my non-debug-able executables is a white triangle inside a blue circle. What does this mean?

Any suggestions? I have spent nearly two weeks searching through websites for help. I am even trying it on windows later tonight! Please help.

Re: Debugging Issues [message #758130 is a reply to message #758123] Mon, 21 November 2011 21:15 Go to previous messageGo to next message
Eclipse UserFriend
On 11/21/2011 06:37 PM, mamorena12 wrote:
> Hello everyone,
>
> I am running Eclipse Indigo on Mac 10.5.8. I have experimented with
> several C projects but cannot get any 'sophisticated' project into debug
> mode.
>
> If I make a basic Hello World and auto-generate a makefile, then debug
> (and breakpoints) works. However, if I write my own makefile (same
> HelloWorld.c) then build and run both execute fine, but not debug mode.
> It compiles and runs in Mac Terminal. But in Eclipse, the breakpoints
> are ignored ("blue dots" become "yellow triangles" as breakpoint icons).
> This is consistent with the same basic Hello World example as well as my
> thesis research involving many more subroutines. I don't think it is
> some incorrect permutation of Eclipse's options (binary/error parsers
> (I've used Mach-O 64 and/or Elf), or toolchain (I've used Cross GCC or
> MacOSC GCC with gcc/cc w/wo -WO3), or compiler (/usr/vacpp/bin) etc, but
> I'm not even sure which is the correct choice of parsers/toolchain?).
> Interestingly I have encounter this same problem of mine with Netbeans.
> Under my projects' debug configurations, I use /usr/bin/gdb (also have
> /usr/bin/gdb-6.8/gdb) and have tried various combinations of my
> /.gdbinit file including:
>
> directory /projects/micromanager/
> directory /projects/micromanager/MMCore
> directory /projects/micromanager/MMDevice
> directory /projects/micromanager/DeviceAdapters/DemoCamera
>
> and the latest from reverse.put.as/gdbinit/. My Debug Configuration --
> Environment is blank.
>
> Finally, I noticed that when the debug mode works for the auto-generated
> (default) makefile, the icons for the binary files are little bugs,
> whereas the icons for my non-debug-able executables is a white triangle
> inside a blue circle. What does this mean?
>
> Any suggestions? I have spent nearly two weeks searching through
> websites for help. I am even trying it on windows later tonight! Please
> help.
>
>
You need to make sure you aren't compiling with optimizations turned on
and also that the compile/link include debug information.
Re: Debugging Issues [message #758131 is a reply to message #758130] Mon, 21 November 2011 21:29 Go to previous messageGo to next message
Eclipse UserFriend
Thank you, but where can I find the options to turn off optimizations and to include debug info under compile/link?
Re: Debugging Issues [message #758175 is a reply to message #758131] Tue, 22 November 2011 03:58 Go to previous messageGo to next message
Eclipse UserFriend
mamorena12 wrote on Tue, 22 November 2011 03:29
Thank you, but where can I find the options to turn off optimizations and to include debug info under compile/link?

If you write your own Makefile you must set these options there (compiler options). Optimizations are usually switched off. To get debug info you must add the compiler option "-g".
Re: Debugging Issues [message #758354 is a reply to message #758175] Tue, 22 November 2011 16:13 Go to previous messageGo to next message
Eclipse UserFriend
Where in the makefile should I put the "-g"? Perhaps in the "Compiler invocation arguments" box? I don't see where it is used in the default makefile. I have compiled with "cc" and "gcc". Also, where/how do I explicitly switch off the "optimizations" in my makefile? Thanks.
Re: Debugging Issues [message #758602 is a reply to message #758354] Wed, 23 November 2011 15:24 Go to previous message
Eclipse UserFriend
You have to look at the documentation of your compiler/linker. That should tell you what options need to be specified to get debugging information. You then have to put them into the compile/link commands in your make file.
Previous Topic:Eclipse Keeps Forgetting/Losing Miscellaneous->Other Objects
Next Topic: Cannot build: all build commands fail without error, do nothing.
Goto Forum:
  


Current Time: Wed Jul 30 12:16:47 EDT 2025

Powered by FUDForum. Page generated in 0.04304 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top