用于处理/解调函数的函数 [英] Function to mangle/demangle functions

查看:13
本文介绍了用于处理/解调函数的函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我之前在这里表明C++函数并不容易代表大会.现在我有兴趣以一种或另一种方式阅读它们,因为 Callgrind 是 Valgrind 的一部分,在组装时显示它们已损坏.

所以我想要么破坏 Valgrind 函数输出,要么破坏函数的程序集名称.有没有人尝试过这样的事情?我正在查看 网站 并发现以下内容:

<块引用>

实现解压缩的代码是 GNU Binutils 包的一部分;参见 libiberty/cplus-dem.c 和 include/demangle.h.

有没有人试过这样的东西?我想在 C 中进行 demangle/mangle.

我的编译器是 gcc 4.x.

解决方案

使用 c++filt 命令行工具对名称进行解调.

I have previously, here, been shown that C++ functions aren't easily represented in assembly. Now I am interested in reading them one way or another because Callgrind, part of Valgrind, show them demangled while in assembly they are shown mangled.

So I would like to either mangle the Valgrind function output or demangle the assembly names of functions. Anyone ever tried something like that? I was looking at a website and found out the following:

Code to implement demangling is part of the GNU Binutils package; 
see libiberty/cplus-dem.c and include/demangle.h.

Has anyone ever tried something like that? I want to demangle/mangle in C.

My compiler is gcc 4.x.

解决方案

Use the c++filt command line tool to demangle the name.

这篇关于用于处理/解调函数的函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆