Help in debugging an Audio Server Plugin

I followed apple's demo application to create an audio server plugin named NullAudio. However, since the code is written in C with some COM interfaces, it is hard for a Swift Programmer. So I want to attach XCode to the Null Audio Plugin to take a look at the method calls.

I googled and found the audio server plugin maybe debug in this way:

Note the BGMDevice is another audio server plugin they created.

So I followed, xcode attaches to coreaudiod process.

But any breakpoint in the code just go grey, how can I make the break point active?

Answered by DTS Engineer in 724224022

Those instructions are out of date by several years. In current macOS versions, your ASP runs in its own process. Once you've installed the plugin, you should be able to find its process ID in (e.g.) Activity Monitor, by filtering on the plugin name. Then you should be able to attach directly to that process from Xcode.

Accepted Answer

Those instructions are out of date by several years. In current macOS versions, your ASP runs in its own process. Once you've installed the plugin, you should be able to find its process ID in (e.g.) Activity Monitor, by filtering on the plugin name. Then you should be able to attach directly to that process from Xcode.

Updated my successful debug setup, hoping to help someone sometime.

With Activity Monitor opened, one important thing to do is toggle the All Process option. Then you will see your target process. The user of this process is _coreaudiod.

Once you get the PID, you can attach it to the process with its PID. No need to kick restart the coreaudiod service.

Hello I also was testing the NullAudio example and could not get XCode to attach to the PID. I found out that I had to disable SIP (system integrity protection) to make it work successfully.

Help in debugging an Audio Server Plugin
 
 
Q