Debugging x86_64 app under Rosetta with Xcode on M1

My team is working on the arm64/universal conversion of a large application with lots of third-party dependencies, but while that work is in progress we are trying to support customers running the app under Rosetta on M1 macs.

To that end it will be helpful if we can actually debug the x86_64 build running under Rosetta on M1, but we see lots of instability when we try this. The app will not even launch if the thread sanitizer setting is turned off. Sometimes the app still fails to launch and/or the debugger fails to attach. It will sometimes show the error message "LLDB provided no error string". No breakpoints are hit during attempted debugging.

Note the app is a plugin host, and we sometimes see a main queue crash on ImageLoader::recursiveInitialization when we attempt to debug.

Is debugging a non-trivial x86_64 app under Rosetta on an M1 machine supported by Xcode? Are there any special configuration steps to get it to work? (We can debug a trivial Hello World x86_64 app fine this way so it seems to be related to more complex app architecture).

Also FWIW we tried launching Xcode itself under Rosetta on the M1 machine as well to see if that would resolve any debugging conflicts, but it didn't correct these issues.

Thanks for any guidance!

Are you by any chance using TSAN build?

Debugging x86_64 app under Rosetta with Xcode on M1
 
 
Q