Today I tried to debug a program on Solaris SPARC by gdb, and it does not work. I was asked to use dbx, then I managed to debug the program.
My Question:
1. When can a program be only debugged by dbx, not gdb?
2. When do we need to use gdb, not dbx?
3. Does it depend on the compiler that compiled the code?
Thank you!
Your question is of very poor quality: "doesn't work" can mean great variety of things, and the answer of why it didn't work depends on details, which you didn't provide.
Generally, compilers on Solaris emit debug info in a standard DWARF format that debuggers (such as
gdbanddbx) understand and interpret.However, there are several versions of the format (current is version 4), and if your debugger is old but your compiler is new, then you are likely to have problems.
Other reasons you may have problems:
DWARF4info.CC, and it emits incorrectDWARF4info, whichgdbrejects, but whichdbxaccepts.ccemittedSTABSformat, whichgdbmay no longer support. (This does not appear to be the case though.)