Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I see symbols of (C and C++) binary on linux?

Which tools do you guys use? How do demangle c++ symbols do be able to pass it to profiler tools, such as opannotate?

Thanks

like image 442
vehomzzz Avatar asked Sep 04 '09 14:09

vehomzzz


People also ask

How do I get symbols in .so files?

The flag -g is used to show only exported symbols. Show activity on this post. Try adding -l to the nm flags in order to get the source of each symbol. If the library is compiled with debugging info (gcc -g) this should be the source file and line number.

What are binaries in Linux?

Linux Binary Directory. Binary files are the files which contain compiled source code (or machine code). They are also called executable files because they can be executed on the computer.


1 Answers

Use nm to see all symbols and c++filt to demangle.

Example:

nm -an foo | c++filt 
like image 200
Dan Moulding Avatar answered Oct 27 '22 01:10

Dan Moulding