Also, I really like Xcode's contextual debugging where I can see most of the variables and information without any extra effort. With terminal the debugging is comparatively hectic.
So, is there any way I can attach to System Extensions by name in Xcode? I have tried using target name as well as extension bundle identifier and several other combinations. From terminal I can attach using bundle identifier of the extension itself.
Due to the way that sysexes are loaded — they are very different from apexes! — I would not expect to be able to attach before the process is running. However, you wrote:I would like to be able to start debugger using process name and
launch the extension and be able to debug from first line of code in
extension.
and I would expect name and PID to work equally well here, that is, they both work or they both don’t. That fact that’s not the case is weird.If the extension is already running, then I am able to attach by PID
but never by name.
Try this…I have tried using target name as well as extension bundle identifier
and several other combinations.
Run lldb using sudo.
Code Block % sudo lldb
Type in this command:
Code Block (lldb) process attach -n ***
but don’t press Return. In this context *** is the name that you successfully attached with in the past.
Press Tab.
LLDB should print a list of candidates. Copy the full expansion of the sysex name.
Go to Xcode and enter that into Debug > Attach to Process by PID or Name.
Does that work?
Oh, and btw, if you want to debug from the start of your sysex, add a call to pause at the beginning of main. That’ll pause waiting for you to attach with the debugger (attaching delivers a signal which breaks you out of pause).
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"