Plugin works fine, but fails to attach to debugger

My plugin recovered from a mysterious crash, and all of a sudden I can’t attach it to auvaltool in debug mode.
But when simply running auvaltool -v ... from the terminal it passes validation.

This is the output I’m getting in debug mode:

ERROR: Cannot get Component's Name strings
ERROR: Error from retrieving Component Version: -50

* * FAIL
--------------------------------------------------
TESTING OPEN TIMES:
FATAL ERROR: didn't find the component
Program ended with exit code: 2

Same goes for Logic: When I try to attach the debugger the plugin won’t show up at all in plugin manager.
But if I just build the project and open Logic, the plugin is there. Always updated with the latest changes I made.

Anyone can give pointers on that? Does it makes sense at all?
I would really like to get my debugger back…

You can’t currently debug AU plugins in Logic unless you disable SIP. Search the forum for debug AU logic and you’ll find plenty of comments from irate developers about this.

Thanks. Did that a while ago. When I run csrutil status I get System Integrity Protection status: disabled.

The issue though is not that I can’t debug, its that auvaltool will not find my plugin if I attach it in Xcode.
This behavior started after a crash, so I feel like auvaltool has a bad version of the plugin in some cache somewhere, so it refuses to load it.

So to recap:

  • running auval -a from terminal - plugin is shown
  • running auvaltool -v <args> from terminal - plugin passes validation
  • in Xcode, edit scheme and attach plugin to auvaltool - component not found error.

I assume you’ve cleared AU cache?

Yes. I think I did every trick in the book:
Clear AU cache, clear build folder, clear components folder, drag out of components folder to desktop and back, restart the machine…

The thing is that if I just build the project and open Logic directly and not from Xcode, it loads the plugin just fine. It even shows the latest changes I made without having to do any of the steps mentioned above.

The problem occurs only when I try to attach the debugger to Logic, auvaltool or juce AudioPluginHost.
If I try to attach the debugger to pluginval, it shows up correctly.

Is this relevant?

It is, but I already performed this step. This worked for a while but lately I did something wrong and now I’m getting exit code -2, which usually means some 32/64 bit issue or something similar.

I did manage to make some progress: Until now I build the plugin for Rosetta on my M1. When switched to Arm64, I am now able to load the plugin in Logic in debug mode.
However, in this setup the breakpoints are not getting hit and DBG statements are not printed to the console. That was the reason I switched to Rosetta in the first place.

So this whole thing is related to M1 architecture more than anything else.
Thanks for trying to help.

Sorry I can’t be more of a help. Please let me know if you find the solution. I moved to an M1 machine myself recently, and it’s been anything but smooth sailing.