用于处理/解调函数的函数

Function to mangle/demangle functions(用于处理/解调函数的函数)
本文介绍了用于处理/解调函数的函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我之前在这里表明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.

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

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

Unable to access non-const member functions of objects in C++ std::set(无法访问 C++ std::set 中对象的非常量成员函数)
Constructing std::function argument from lambda(从 lambda 构造 std::function 参数)
STL BigInt class implementation(STL BigInt 类实现)
Sync is unreliable using std::atomic and std::condition_variable(使用 std::atomic 和 std::condition_variable 同步不可靠)
Move list element to the end in STL(在 STL 中将列表元素移动到末尾)
Why is overloading operatoramp;() prohibited for classes stored in STL containers?(为什么禁止对存储在 STL 容器中的类重载 operatoramp;()?)