I am using clang on a linux environment to compile a C program. When trying to debug the executable using ddd, it does not find the debug symbols (yes, they are included). When I use gcc instead of clang to build, then ddd seems to work fine.
According to the documentation, one can define the "inferior debugger" (the underlying debugger) in a ddd session. By default is auto-detects the debugger to use, and for my program it uses gdb.
How can I debug the clang executable with ddd? Should I use a different inferior debugger, and if so, which one?
Note: according to the docs, lldb is not supported by ddd.
Update: here's what clang reports:
clang version 16.0.6
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /tools/oss/packages/x86_64-rocky8/llvm/default/bin
and the command line used:
$ clang -g -O0 -o ddd_test.e ddd_test.c
$ ddd ddd_test.e
The result:
When using gcc:
$ gcc -g -O0 -o ddd_test.e ddd_test.c
$ ddd ddd_test.e
The result is:
Running on Rocky Linux 8.10


gccandclang, and in both case, using defaultgdbas "inferior" debugger (which, indeed, is the only one that counts.ddddoes know anything about debugging. It is merely a window with buttons that replace "step", "next", etc. Displays code source, translate line number into some highlight in the code source, etc. Not saying it is nothing. But well, it is a graphical tool that calls gdb, and feed it some strings in a pipe, and parse the strings that gdb prints)clangcompiled programs work well withdddhere, or directly withgdbwithout complaining about symbol (and showing correct line number, function names, variables names and values, etc.)clang, what platform/distro are you on? Version of clang?gdb? From the partial output shown (as an image...) this looks like the same issue as in stackoverflow.com/questions/17958650/…