C++ get the mangled names of a function/method

时光毁灭记忆、已成空白 提交于 2019-12-23 10:24:43

问题


Hi I need to determine the mangled name of a function from within an c++ app itself. Is there any equivalent to the __FUNCDNAME__ macro in g++ ?


回答1:


To get the demangled name use __PRETTY_FUNCTION__.

Better is to use:

#include <boost/current_function.hpp>

BOOST_CURRENT_FUNCTION

This gives the demangled name. I looked at cxxabi.h but there does not seem to be a mangle function. Do you really want the mangled name?



来源:https://stackoverflow.com/questions/3262585/c-get-the-mangled-names-of-a-function-method

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!