Anyone having luck debugging in BitWig?


#1

I’m trying to debug my plugin in BitWig (currently on Mac). Is anyone having any luck with this i.e., connecting the debugger and stopping on breakpoints?

So far, it crashes if using BitWig as a the executable (SIGSEGV) and if I connect the debugger after launching BitWig then I get an EXC_BAD_ACCESS (with address 0xc so looks like a nullptr deref).

This is all BEFORE even loading the plugin! It could of course be a deliberate measure against cracking…

Any thoughts?


#2

I’ve only tried on windows, but I guess the same strategy applies to Mac version.

Bitwig runs each plugin in a separate process, so you need to attach the debugger to the plugin host process rather than to bitwig master process. You can do this easily after the plugin has been loaded.


#3

Thanks, yes I can see that now. It’s the same on Mac.


#4

that’s insane :\ I have found a bug in one of my plugins that requires me to check what Bitwig does when it loads the plugin… but I can’t find a way to do such a simple task, since I have to manually attach the debugger AFTER the plugin is loaded. Any of you had more luck?


#5

I seem to remember (certainly on the Mac) that you can attach the debugger to bitwig’s plugin process then go through adding your plugin to a track.


#6

I’ve tried several things and I’ve been able to disable the creation of a separate process for each plugin… but nothing seems to work. If I attach the debugger to the main process, it crashes (protection against debuggers and decompilers)… if I attach on the other process it creates, I don’t get ANY of my DBG messages. I tried to get in touch with the developers, but no answer so far… so, basically, I’m very close to explicitly not provide compatibility for Bitwig.


#7

I found myself in the same situation while debugging Pro Tools: no DBGs printed in the Xcode window after you attach the debugger.

What worked for me was to start the host from the command line in Terminal: the DBGs at that point were being printed in that Terminal window, while still retaining the possibility to attach the debugger


#8

didn’t worked :\ I ran Bitwig from terminal and attached the debugger to the engine process (as suggested from Bitwig devs)… no DBG messages. that’s more frustrating than debugging AAX plugins. The issue I’m having is that the plugin state is not correctly loaded. I read that this happens with other developer’s plugins too, but until I don’t have any way to see what’s going on I’ll be forced to tell my customers we don’t support Bitwig.


#9

When you attach to the process BitwigPluginHost, it does load symbols for loaded plugins. You can confirm this by setting a breakpoint somewhere in your plugin’s startup code.

The problem is that output from the plugin to stdout / stderr seems to get consumed by the BitwigPluginHost process.

I worked around this by logging to file instead of stdout / stderr.

You can do this by inheriting from the Logger class, and overriding Logger::logMessage()