Good afternoon.
There is a certain application that loads plugins on startup (I mean a binary file in which the implementation of several classes is located under the plug-in; such a file cannot be executed separately from the parent application), calls a couple of functions described in these plugins and unloads them from memory.
The question is : can gdb “join” to such a plugin for debugging (i.e., will join before any code in the plugin is executed)?
There is, of course, a head-on solution — to place an interrupt in the host application immediately after the plug-in code has been loaded but not yet executed (but this application is quite voluminous and it will take a long time to find the right place in it).
I came up with another solution (which I am using at the moment) - I launch the application in the debugger, wait for the plugins to load and complete the work. Then I put a breakpoint on the desired method ( bp "[NSColor blueColor]"
), run the application again, stop at the breakpoint and memorize the offset for this point. Then either I step manually, or calculate the desired offset, based on that found above. But this is somehow ugly, there must be another way, I guess.
Thank.