gcc does not generate debugger info when using -g, -ggdb, -g3, or -ggdb3
- by CJJ
I'm using GCC 4.4.1 and GDB 7.0-ubuntu on Ubuntu 9.10. However, GCC won't generate debugger info when using any of the following switches: -g, -g3, -ggdb, or -ggdb3. So when I run the program with GDB, its as if there was no debugger information generated. I have created very simple test source files in a new, empty folder. Here is one example:
#include <stdlib.h>
#include <stdio.h>
int main (int argc, char **argv)
{
char msg[4];
// allocate 4 bytes on the stack
strcpy (msg, "hello world");
// overflow
printf ("%s\n", msg);
return 0;
}