How to check if program was compiled with debug symbols? [duplicate]

You can use file and objdump on Linux. In particular, you can look at whether file says “stripped” or “not stripped” (under my Ubuntu 20.04.1 LTS, whether an executable is compiled with -g or not shows not stripped with file command. But the one with -g, shows with debug_info, in addition to that), and whether objdump --syms outputs anything useful (for me, it says “no symbols” for a regular build).

Leave a Comment