GDB中特定对象的断点
Breakpoint in GDB for specific object
我需要检查从哪里调用某个特定对象的析构函数。假设它是std::字符串,位于0x9b993e4。我尝试执行以下操作:
b std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string if (this==0x9b993e4)
但GDB说"没有符号",这是"在当前的背景下"我也试过
b std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string if (std::basic_string<char, std::char_traits<char>, std::allocator<char> >::this==0x9b993e4)
GDB看起来像设置断点,但当我运行时,它会停止并写入
Error in testing breakpoint condition:
There is no field named this
有人能告诉我如何破解特定对象的析构函数吗?
提前感谢!
我找不到比使用寄存器更好的方法了。所以,在x86上,你可以检查EAX,在ARM上,可能是R0。
b ClassName::~ClassName if ($eax==<object_address>)
在我的情况下,这个解决方案不适用于某些全局静态对象。
break std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()
相关文章:
- 什么时候调用组成单元对象的析构函数
- 对RValue对象调用的LValue ref限定成员函数
- CMake-按正确顺序将项目与C运行时对象文件链接
- 空基优化子对象的地址
- 将对象数组的引用传递给函数
- 你能重载对象变量名本身返回的内容吗
- C++使用整数的压缩数组初始化对象
- 找不到成员对象:没有名为get_event()的成员,也处理多态性和向量
- 将对象移动到std::shared_ptr
- 代理对象的常量正确性
- 提升 ASIO 无法识别计时器对象
- 将Ref对象作为类成员
- 视觉对象触发了断点 c++
- 如何在 gdb 中的所有构造函数上同时为 C++ 对象设置断点?
- 视觉对象C++创建动态数据断点
- 在共享对象文件中设置 GDB 断点
- 使用gdb,可以在静态对象销毁后添加断点
- GDB:调用特定对象的析构函数时的断点
- GDB中特定对象的断点
- 如何在特定对象的特定方法中设置断点