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

adfjoawesdfi picture adfjoawesdfi · Apr 30, 2009 · Viewed 23.7k times · Source

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?

Answer

Bob Yoplait picture Bob Yoplait · Mar 16, 2011
  • 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)