static_rtti
static_rtti

Reputation: 56342

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

In gdb, is it possible to set a breakpoint on a member function called on a specific object? To be more specific, imagine class A has a member function Foo(). I'd like the program to stop when Foo is called on a specific object of type A (0xFF11DEADBEAF for example).

Is this at all possible?

Upvotes: 5

Views: 1155

Answers (1)

dirkgently
dirkgently

Reputation: 111298

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

Upvotes: 7

Related Questions