Carbide.C++ for debugging Win32 applications
As per my previous post, Carbide.C++ can be used for standard Win32 C++ development. This uses the facilities of the normal Eclipse C Development Toolkit (CDT) upon which Carbide.C++ is built. That, in turn, uses GCC for compilation, MinGW headers for Win32 API support, cygwin1.dll for UNIX API support, and GDB for debugging.
All of this works fine under Carbide.C++, except GDB support. That’s because Nokia has added support for their own (née Metrowerks) debugger.
These debuggers obviously have different capabilities, and they’re represented by different Java classes. The upper layers of CDT (which Nokia have branched) query these debugger classes to find out whether they support certain capabilities.
Unfortunately, the upper layers ask a series of questions which are not understood by the lower layers. Rather than replying ‘no’, the old GDB code simply fails.
To see this happening, turn on the GDB logging described here.
The solution is to add the required methods to the GDB debugger, returning false. Here’s how to do that, in very vague terms. You might need to know a bit about Eclipse to be able to follow this recipe.
- Install the Eclipse plug-in development environment into Carbide.
- Install the source code for the CDT plug-ins into Carbide, probably from the Carbide update site.
- Open the plug-in development perspective.
- Go to the Plug-ins view
- Find org.eclipse.cdt.debug.mi.core, right-click, go to Import -> As source project
- Switch to the Package Explorer view, and open org.eclipse.cdt.debug.mi.core.
- You should find the Problems view lists about 10 compile errors relating to the unimplemented methods
- If not, also import org.eclipse.debug.core in a similar way
- For each compile error, double-click on it to open the relevant source.
- Click on the class name (which will be underlined due to the error). Press Control-1 to bring a list of selections for how to fix them. Choose Add Unimplemented Methods
- There should be no compile errors left (warnings are OK)
- Open the plugin.xml
- Increment the version number to 3.0.2.5. (Carbide-branched components gain an extra ‘.5′ on the end; we might as well do the same).
- Right-click on the plug-in and choose Export. Pick Deployable Plug-ins and Fragments
- Save the zip file to somewhere
- Unzip the contents of the zip file to c:\program files\nokia\carbide.c++ or wherever appropriate. This will give Carbide an org.eclipse.cdt.debug.mi.core 3.0.2.5 plug-in alongside the existing 3.0.2; it will choose the later version
- Restart Carbide.C++
- Debugging Win32 programmes (or UNIX programmes using cygwin) should now work
