How to tell if a binary is release or debug in both win and *nix

compiler-constructiondebuggingrelease

Is there a simple command line utility to inspect binaries like executable and dynamic libraries to tell if they are release or debug versions? Is there anything like that on *nix or windows?

Best Solution

  • for C++ on Linux, you can do:

        objdump --source yourbin |grep printf
    

    Replace printf with whatever function call you do. If it is debug, it will display all the actual source code call you do. If it is release, it will just display the founded symbol from the symbol table.

  • for C++ on Windows, you can use depends.exe and see if it depends on MSVCRT (release) or MSVCRTD (debug)