I'm working on a Komodo extension with a module written in C++. I compiled it with the libraries from Firefox 3.0.4 (because it has mozilla version 220.127.116.11 and Komodo seems to have 18.104.22.168pre). I can't seem to convert UTF-16 strings to UTF-8 using the XPCOM library. I've tried
NS_StringGetData(nsDependentString(str),&buffer) and they all resulted in a NULL pointer (
"t\0o\0_\0d\0e\0b\0u\0g\0.\0c\0p\0p\0\0\0" if cast to
Here are the relevant files (compiled for x86 linux):
(note that if you try to use the module, it currently doesn't check for NULL output from those functions and subsequently crashes Komodo, so don't try to use it if you have unsaved files.)
Since I'm already sharing it, I may as well explain what I'm working on. I'm working on an extension that allows Komodo to compile and debug C++ programs. Later I might add C support and see if I can add intelligent autocomplete support. The extension is essentially a front-end to gcc and gdb.
In the extension, build.js does the compiling. Currently it uses all source files found in the project directory. It will instead use only the source files that are part of the project when I figure out how. It calls gcc -MM to determine source file dependancies and only compiles/links targets if the dependant files are newer or the targets do not exist.
libgdbgpsession.so implements koIDBGPSession and communicates with a gdb process using the GDB/MI interface. It is intended to be something that can be passed to Komodo in place of one of its other debuggers and have everything work the same. Then I'll need to create a new interface inheriting from koIDBGPSession to add support for things that only make sense for compiled programs like viewing disassembly.