Setting a breakpoint for a member function called on a specific object

In gdb, is it possible to set a breakpoint on a member function called on a particular object? To be more specific, imagine that class A has a member function Foo (). I want the program to stop when Foo is called on a specific object of type A (e.g. 0xFF11DEADBEAF).

Is it possible?

+3
source share
1 answer

Usage: b <Classname>::<functionname> if this==0xDEADBEEF(btw: all instances share member function addresses.)

+6
source

Source: https://habr.com/ru/post/1732057/


All Articles