Leaking memory. And worse, it wasn't drawing its buttons (group wasn't
setting view contexts) and then the buttons were in the wrong place, so
had to add a backing buffer for the buttons.
This puts a print command (to Sys_Printf) into the queue making it
easier to check command sequences since regular printf is asynchronous
with the stream.
It currently dies when single stepping or exiting due to EditBuffer's
retain count not getting incremented when initialized. This is because
EditBuffer is initialized in C and thus does not call Object's -init.
While trying to build a view without deriving from it was a neat idea,
it doesn't work so well because a view really needs to know how to draw
itself. This even fixes the segfault when stepping past the end of the
program.
For now it just manages type encodings via their encoding string,
ensuring types are fetched from the target only once, if at all (may
already have the type due to it being common).
Things were getting rather cluttered with everything being qwaq-* and
all in one directory. Now most have lost the qwaq- prefix and have been
moved into subdirectories (non-recursive make).
The view is recorded as having focus but is not given focus until the
parent view is actually in focus. This fixes the locals view not having
focus at startup and thus blocking F7.
Changing str_free's return type highlighted that I'd missed an edit when
I did the big ruamoko build cleanup.
Also silence the sed/mv noise now that things are working nicely.
And rename prd_exit to prd_terminate (the idea is the host will
terminate the VM). This makes it possible for the debugger to pause the
VM before any code, even a builtin function, is executed. Breaks the
debugger source window, but only because it's not updating on file
change (I think).
I decided I want events for VM enter/exit but enter needs to somehow
pass the function which will be executed (even if a builtin). A generic
void * param seemed the best idea, which meant the error string could be
passed via the param instead of a "global" string in the progs struct.
After a lot of thought, I have come to the conclusion that the weird
crash the other day was caused by a race while the command ring buffer
had just been emptied: the command submission code opened up space for
writing, threads switched, and command processing saw the available data
and pounced on it before the submit code could write valid data. Thus
include the while header in the lock, and move the loop-end release
outside the lock. It may be a little confusing, but it seems to work.
They take a pointer to a free-list used for hashlinks so the hashlink
pools can be per-thread. However, hash tables that are not updated are
always thread-safe, so this affects only updates. progs_t has been set
up such that it is easy for multiple progs within one thread can share
hashlinks.
That... worked nicely. Program exit needs some work because exiting
terminates the thread and the debugger has no clue about it, but I was
able to single-step through gcd.r quite nicely.
This will allow for easy expansion of editor functionality without
messing with the editor itself. In particularly, an editor normally
doesn't need to know anything about debugger hot keys.