Forrest logo
back to the nm tool

nm:tldr:ba4c9

nm: Demangle C++ symbols (make them readable).
$ nm --demangle ${filename-o}
try on your machine

The command nm --demangle ${filename-o} is used to demangle symbols in a compiled object file.

Let's break down each part of the command:

  • nm: nm is a command-line tool in Unix-like operating systems that lists symbols from object files, libraries, or executables. It displays symbol names along with their corresponding addresses and types.

  • --demangle: The --demangle option is used with the nm command to demangle mangled C++ symbols. In C++, names of functions, variables, and other entities are often mangled (or decorated) during the compilation process for various reasons like supporting overloading and name mangling. The --demangle option helps in displaying these mangled symbols in a human-readable format.

  • ${filename-o}: ${filename-o} is a placeholder for the name of the object file that you want to analyze using nm. The -o is an option (short for --format=sysv) which specifies the format of the object file. You would replace ${filename} with the actual name of the object file you want to inspect.

So, when you run the command nm --demangle ${filename-o}, it will use nm to list symbols from the specified object file, while demangling and displaying any mangled C++ symbols encountered.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the nm tool