I am trying to debug a class that is heavily dependent on inheritance. A debugging session is tedious because it involves one object calling the same function on another object in the chain. I spend a lot of time making unnecessary code that could be better spent elsewhere.
Here is a simple one: I want to set a breakpoint for an instance of the class using a wildcard, for example b Foo::* . That way, when the material that interests me falls within the scope (e.g., a static function or a member function), the debugger will be bound.
Here's the tricky one: a parameterized class: I want to set a breakpoint on the template function of a class member using a wildcard, for example b Foo<*>::bar . (The real problem is much worse, because the template parameters themselves are templates themselves).
Although GDB seems to allow me to install one, the debugger does not stop (see below). He claims to set a milestone for future workloads. In fact, I used static binding and the characters are already present. No libraries will be loaded.
How to set a breakpoint using wildcards?
(gdb) b CryptoPP::PK_EncryptorFilter::* Function "CryptoPP::PK_EncryptorFilter::*" not defined. Make breakpoint pending on future shared library load? (y or [n]) y Breakpoint 2 (CryptoPP::PK_EncryptorFilter::*) pending. (gdb) r Starting program: /home/cryptopp-ecies/ecies-test.exe Attack at dawn! [Inferior 1 (process 5163) exited normally]
and
(gdb) rbreak CryptoPP::DL_EncryptionAlgorithm_Xor<*>::SymmetricEncrypt (gdb) r Starting program: /home/cryptopp-ecies/ecies-test.exe Attack at dawn! [Inferior 1 (process 5470) exited normally] ... (gdb) rbreak CryptoPP::*::SymmetricEncrypt (gdb) r Starting program: /home/cryptopp-ecies/ecies-test.exe Attack at dawn! [Inferior 1 (process 5487) exited normally]
source share