noobprogrammer1987
noobprogrammer1987

Reputation: 103

dbx: warning: 'main' has no debugger info -- will trigger on first instruction with the -g option added

I am getting this error message. I have already added the -g option.

dbx: warning: 'main' has no debugger info -- will trigger on first instruction

https://www.ibm.com/docs/en/aix/7.1?topic=d-dbx-command

The ObjectFile parameter is an object (executable) file produced by a compiler. Use the -g (generate symbol table) flag when compiling your program to produce the information the dbx command needs. Note: The -g flag of the cc command must be used when the object file is compiled. If the -g flag is not used or if symbol references are removed from the xcoff file with the strip command, the symbolic capabilities of the dbx command are limited. In addition, do not use the -O compiler option to optimize an executable that you plan to debug with dbx. Optimization rearranges the code and compromises the debug data, further limiting the value of debugging the executable program with the dbx command.

Using a makefile with the -g option.

DEBUG=-g

Then using the makefile.

make -f program.mak; ./program;

Running it from the command line.

cc  -g program.o  program.c
./program

Upvotes: 0

Views: 45

Answers (1)

noobprogrammer1987
noobprogrammer1987

Reputation: 103

First check this tutorial. It has some great info.

https://www.oracle.com/solaris/technologies/dbxerr.html

The most likely answer to this is yes you have added the -g option but you have not actually recompiled your program properly. Just recompiling your program is not good enough. You need to do one of two options to delete your program.o file or if you use a makefile do make -f makefile.mak clean. When you do this correctly you should see a similar message to this. Notice how this time it does have the -g option.

cc  -g -I./ -I../inc -Iusr/local/include -Iusr/local/include/ncursesw -I/export/customer/dstn/test/inc -I/opt/oracle/oracle_19.0.0.0/precomp/public -I/opt/oracle/oracle_19.0.0.0/rdbms/public -I/opt/oracle/oracle_19.0.0.0/rdbms/demo -I/opt/oracle/oracle_19.0.0.0/plsql/public -D__sparc -D_STRICT_STDC -features=no%conststrings -xCC -c -o ../uobj/program.o  program.c

Upvotes: 0

Related Questions