Welcome to Kite

Kite is a programming language designed to minimize as much of the programmer experience as possible — quick development and running time and low CPU and memory usage. As this is a new project, we're just getting things started. Feel free to poke around and learn more!

LLVM has a facility to emit debug symbols. As you may know, debug symbols are what allow debuggers such as gdb to work. I’m happy to report that kite–llvm now emits debug symbols and allows gdb to have basic functionality:

Unfortunately, this works only on Linux (Apple’s gdb is too old, as it turns out). Eventually I want to be able to show function names/file/line numbers in exception stack traces on both OSX and Linux, but this may involve some work. Alternatively, would it be possible to automatically start gdb with the application’s current process ID immediately upon getting an unhandled exception? This might require additional debug info to be output, though.

Note the part in bold. Two “ret” statements are being output—the one from “return”, and the normal one that’s generated at the end of every method. Normally LLVM would eventually generate machine code that simply skips over the second ret statement. Or so you’d think.

What I noticed is that System__integer__obj__i() would do the correct thing and return a valid System::object pointer, while kite_find_funccall() would get a totally different pointer. Even though according to the above, the return value from obj__i() gets fed directly into kite_find_funccall(). I confirmed this time and time again in gdb.

The fix? Using the same code suppression logic that I implemented for break/continue to suppress the last ret. Now it works as intended:

$ ./kite
method x()
[
return 1;
];
x()|print;
^D
1
$

EDIT: this was on LLVM 2.9. I have yet to try 3.0 to see if this issue’s fixed there. If not, a bug report might be pending in the future.