How to break with GDB at object destruction if there is no destructor?
How to break with GDB at object destruction if there is 开发者_Python百科no destructor?
If there's no destructor, you cannot break on the destructor, as there is no op-code for the destructor. You have two choices on where to break:
- If the object is allocated on the stack, break on the closing brace of the scope defining the variable.
- If the object is allocated on the heap, break on the delete statement.
- If the object is statically allocated in a data segment, then you can't.
精彩评论