开发者

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

开发者 https://www.devze.com 2023-01-07 19:16 出处:网络
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++ ? To get the demangled name use __PRETTY_F

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++ ?


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?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号