VoidPointer VoidPointer - 1 month ago 10x
C Question

how to know if a binary contains debugging symbols or not without file, objdump or gdb?

I need to know whether a binary has debugging symbols in it or not. Its a production system and so doesnt have commands like


Can provide more info when needed.

OS: Debian


The easy solution, if you don't know if the binary has symbols or not and there are no tools on the actual machine you have the binary on, is to use something like scp (secure remote copy) to copy the file to a machine that has tools.

As the other comment says, using the strings command, which prints anything it finds that "looks like a string" (a long enough sequence of "printable" characters), but it's not quite as reliable, as you never really know what the debug symbols look like, and you can get false positives from code containing symbols from macros etc.