You must ensure that your application is built with debugging information.
Debugging information must be enabled for debug builds and for release builds.
Debugging information must be in the STABS format or COFF format.
You can enable STABS format debugging information by adding the -gstabs option to your compiler command line.
You can enable COFF format debugging information by adding the -gcoff option to your compiler command line.
Be sure that any other -g directives do not override this option.
For example:
gcc -gstabs main.c
gcc -gcoff main.c