Can I ungarble GCC's RTTI names?

后端 未结 3 1342
轮回少年
轮回少年 2021-01-12 23:53

Using gcc, when I ask for an object/variable\'s type using typeid, I get a different result from the type_info::name method from what I\'d expect to get on Windows. I Google

3条回答
  •  一生所求
    2021-01-13 00:29

    c++ function names really include all the return and argument type information as well as the class and method name. When compiled, they are 'mangled' into a standard form (standard for each compiler) that can act as an assembler symbol and includes all the type information.

    You need to run a function or program to reverse this mangling, called a demangler.

    try running

    c++filt myoutput.txt
    

    on the output of the function. This demangles the real symbol name back into a human readable form.

提交回复
热议问题