In my app I have a plugin system that allow users to develop plugins (in C/C++ dylib) and execute them at runtime (using dlopen/dlsym).
Basically I have a main thread (which is drawing my GUI) and another thread (which is the plugin thread) that is loading/running the plugin.
What I would like to do is to allow the user to debug is plugin in Xcode and keep the main thread running.
I already know that in XCode you can create a dylib project and set in Info > Launch > Wait for ??? to launch (which work great), but the problem Im having with that is:
-
If the user stop the dylib debugging it close the main application launched (my app, which I don’t want as I want to keep it running).
-
It stall the main application thread completely (the GUI stop refreshing until the user continue).
Is there any way to still allow the users to use XCode to develop/debug their plugins avoiding the 2 problems above?
Or I’ll have to integrate a text editor and somehow interface clang++/lldb directly inside my app to let the users develop/debug (which sounds to me like alot of work, especially since XCode already have all the functionalities)?
TIA!
lldb has the ability to run all threads when you
stepornext, but when you interrupt the program (press Pause), all threads will be stopped. lldb doesn’t currently have any UI to do what you want — there’s no technical limitation but I don’t think I’ve seen a use case that called for this behavior. There was an obscure command added to gdb,thread dont-suspend-while-steppingwhich would designate a specific thread and tell gdb to allow that thread to run whenever the debugger was step/nexting, but even in that case when you interrupted the program all threads would be stopped..