c++assemblyg++c++filt

can c++filt be used to write the demangled name back in the .s file itself?


I am just trying to learn c++filt, there are not enough example usage available in the web....

I am writing a main.cpp file and trying to read the machine code....

g++ -S main.cpp -> gives me main.s

if I need to find out an demangled value, I could use

g++ -S main.cpp | c++filt <demangled name>

eg)

g++ -S main.cpp | c++filt _Z3gooi

gives me value goo(int i)// which is the signature,

Is there a way, where you replace the current main.s file with demangled values, for example, the _Z3gooi will be demangled as goo(int i) in the file itself, instead of console.... ????


Solution

  • Can be done in

    C++filt<main.s>temp.s