Thursday, November 11, 2010

CDT-EDC Multi Context Debugging

If you are ever at a gathering of the Eclipse CDT community and the conversation starts to drag just casually ask about support for debugging multiple processes, cores, or contexts at the same time. You'll hear about a lot of important interrelated issues and that the committers have been chipping away at them for some time.

One of the nice things about creating the EDC C/C++ debugger in CDT was the opportunity to include ground up support for debugging many contexts at once. But while that's fine under the hood we immediately ran into an important usability issue in the Debug view.

When you launch a debug session you start with a launch configuration that tells the debugger what to do and you end up with a Launch in the Debug View that shows the result. The Launch is usually named after the launch configuration that created it:

When you want to debug something else you can use another launch configuration that will create another Launch in the Debug View:

People find this confusing if both the things you are debugging are running in the same target environment. They expect them to be grouped together in the Debug view and they expect the Launch at the root of the view to represent the overall environment (phone, PC, multi-core system etc.)

The EDC debugger deals with this by letting new launches join existing ones if they are part of the same target environment. For example if you debug a Windows app (Simple.exe) you will get a new debug session and Launch in the Debug View.

Debug a second Windows app (BlackFlag.exe) and it will join the existing one:

EDC uses a description and image of the target environment provided by the debugger implementation. In that case it was the Windows machine name. In this one it's the name of my phone:

Of course there are lots of other issues related to multi context debugging. To see how the CDT community is addressing these you can follow along with the CDT multi-core working group.