pahole 不显示命名空间中的类
pahole doesn't show classes in namespaces
我正在尝试使用pahole来分析C++程序的内存布局,该程序在命名空间中有一些类。 pahole 仅列出全局命名空间中的类。是否有选项也可以列出其他类?
女工程师:
namespace ns {
class Thing {
public:
int y;
Thing(int y) : y(y) { }
};
};
class Thong {
public:
int z;
Thong(int z) : z(z) { }
};
int main(void) {
ns::Thing x(1);
Thong a(2);
return x.y + a.z;
}
g++ -ggdb3 test.cpp
pahole --version; pahole a.out
v1.10
class Thong {
public:
int z; /* 0 4 */
void Thong(class Thong *, int);
/* size: 4, cachelines: 1, members: 1 */
/* last cacheline: 4 bytes */
};
在源代码中查找后,我发现--show_private_classes
选项还打印命名空间中定义的类。
命名空间限定符从类名中删除(ns1::foo
和ns2::foo
都打印为仅foo
),但对于我的用例来说已经足够了。
相关文章:
- 命名空间中具有.h和.cpp文件的类
- 从父命名空间重载类型
- 在命名空间中定义函数还是限定函数
- C++:对不存在的命名空间使用命名空间指令
- 通过继承类使用来自不同命名空间的运算符
- 使用命名空间时出现多个定义错误
- CUDA内核和数学函数的显式命名空间
- 嵌套的匿名命名空间
- CMakeLists.txt中的命名空间表示法
- 类是C++中的命名空间吗
- 在命名空间中使用全局命名空间中的函数
- 如何使 std::sort 在 std::swap 和我的命名空间的模板化交换之间没有名称冲突?
- '使用命名空间{嵌套在另一个命名空间中的某个命名空间}"
- 声明"使用命名空间 C;"对于证明 [namespace.udir]/3 中的示例中显示的结果至关重
- pahole 不显示命名空间中的类
- 资源管理器在 TILE 视图模式下不显示 shell 命名空间扩展的项目详细信息
- 如何显示命名空间中的所有元素
- G++显示关于未定义命名空间的错误
- C++ 编译失败,并显示错误:命名空间中没有名为 'snprintf' 的成员'std'
- 用于c++ 11的Vim语法高亮显示不会混淆其他高亮显示.例如,类/命名空间作用域