- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我正在阅读 Itanium ABI上面写着
It is intended that two type_info pointers point to equivalent type descriptions if and only if the pointers are equal. An implementation must satisfy this constraint, e.g. by using symbol preemption, COMDAT sections, or other mechanisms.
有谁知道在使用动态加载库时如何在流行平台(例如使用 GCC 和 GNU binutils 的 Linux)上实际实现这一点的详细信息?它有多可靠?
此外,我的印象是 MSVC 中的 typeid
比较是(曾经?)使用运行时字符串比较对损坏的符号名称实现的,正是因为不能保证满足此要求。这仍然是它完成的方式吗?是否有技术平台限制阻止 MSVC 使用与 Itanium ABI 平台相同的技术?
编辑 还有一个问题:跨模块边界的异常捕获(在任一 ABI 中)是否也依赖于 RTTI 信息,或者除了等效的运行时 dynamic_cast< 之外是否还涉及另一种机制
s?
最佳答案
MSVC 首先使用指针比较,如果失败,则比较字符串。你可以在VS2012的CRT源中看到实现:
extern "C" _CRTIMP int __cdecl __TypeMatch(
HandlerType *pCatch, // Type of the 'catch' clause
CatchableType *pCatchable, // Type conversion under consideration
ThrowInfo *pThrow // General information about the thrown
// type.
) {
// First, check for match with ellipsis:
if (HT_IS_TYPE_ELLIPSIS(*pCatch)) {
return TRUE;
}
// Not ellipsis; the basic types match if it's the same record *or* the
// names are identical.
if (HT_PTD(*pCatch) != CT_PTD(*pCatchable)
&& strcmp(HT_NAME(*pCatch), CT_NAME(*pCatchable)) != 0) {
return FALSE;
}
...
Itanium ABI 总是只使用指针比较。它应该与 DLL 一起工作的方式是动态加载器应该确保程序地址空间中的每个异常都有一个 typeinfo 对象的单个实例。
如果您对异常 RTTI 的实际实现和捕获信息感兴趣,请查看我的 OpenRCE article (MSVC) 和 Recon 2012 presentation (海湾合作委员会,MSVC x64)。
关于c++ - Itanium 和 MSVC ABI 中跨模块边界的 RTTI,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15211667/
有人告诉我: [ABIs] guarantee the exact layout of the struct, byte offset of every member, which bits are
关闭。这个问题是off-topic .它目前不接受答案。 想改善这个问题吗? Update the question所以它是 on-topic对于堆栈溢出。 8年前关闭。 Improve this q
我正在阅读 here关于如何选择主要碱基: "...2. If C is a dynamic class type: a. Identify all virtual base classes, dir
寻找可用于检测 HP-UX Itanium 平台上的静态/运行时内存泄漏的各种工具(免费/商业)。 背景,我们: 使用 HP-UX 11.31 ia64。但是,我们所有的应用程序仍然只有 32 位。
Itanium ABI 指出异常的内存是通过调用 __cxa_allocate_exception(size) 获得的。返回内存的对齐保证是什么? 最佳答案 Section 1.2 in chapte
我正在开发 C/C++ 跨平台代码,最后一个平台是基于 Itanium 的 HP-UX。问题末尾可以找到相关的机器和处理器信息。 我需要为下面给出的机器和编译器规范实现或找到原子比较和交换。 我已经找
我正在尝试调试使用 libevent 库的代码。在该库中,有一个函数 event_new 假设创建一个 event_cb。不知何故,在我分派(dispatch)事件库后,无法调用或访问 event_c
我需要在 HPUX(Itanium 和 PARISC)中获取用于交换信息的命令。 最佳答案 这是 unix.stackexchange 的链接那对我有帮助。谢谢@乔纳森 /usr/sbin/swapi
我正在阅读 Itanium ABI上面写着 It is intended that two type_info pointers point to equivalent type descriptio
我需要为 Itanium 编译我的代码,但似乎所有编译器(ecc、gcc、orc)都需要 Itanium 机器来执行此操作。有什么建议吗? 最佳答案 您需要将 gcc 设置为交叉编译器。这涉及到自己构
例如: template struct foo { using bar = int; }; // _Z3bazi void baz(foo::bar quux) { } template
昨天我了解到,针对 AMD64 和 Itanium 目标进行编译时,Microsoft Visual C++ 不支持内联汇编(使用 __asm 关键字)。 这是正确的吗?如果是这样,有谁知道为什么他们
我在同时运行 64 位 Oracle 10.2 的 64 位 Itanium 服务器上运行 Windows Server 2003,我想为 Python 2.5 安装 cx_Oracle。我之前在 W
我是一名优秀的程序员,十分优秀!