Kabuta adapts Delve's API to GDB/MI interface for the purpose of making Delve available to various front-ends (IDE, GUI debugger interfaces, etc.) that already have integration with GDB.
This is currently oriented to my use of Goclipse as a primary use case. Other use cases are welcome; it's just that this one is what I am familiar with.
This is currently being developed with GoClipse as the main use case, and so also using GoClipse. This is my development setup, as a reference:
- In the Eclipse workspace, there is the Kabuta GoClipse project, in whose src sdirectory there is github.com/debedb/kabuta pointing to this repo.
- Under the repo structure, in testdata/, there are the following projects:
a. cdtproject -- an Eclipse CDT project which contains a simple C program
to be debugged -- to be used as a reference. If you use Eclipse, then create a project with it (TODO) b. goclipseproject -- a GoClipse project containing a Go project to be debugged. The idea is that this Go project has enough Go features to try out the concept. If you use Eclipse, the create a project with it (TODO)
Because Kabuta is invoked by a front-end which is designed to use GDB, it is limited to being invoked with the same command-line arguments as GDB. Therefore, to configure its behavior environment variables and/or an init file are used. The rules are as follows:
- First, the init file is loaded. Init file is
~/.kabutainit
. Its evaluation is simple:- It is considered line by line.
- Each line is stripped of surrounding whitespace
- If the line is empty it is ignored
- If a line starts with # it is ignored (comments)
- The line is split on the first = (equal sign). If there is no equal sign, the line is ignored. If there is, whatever is to the left is the key, and whatever is to the right is the value.
- Based on the above rules, a key-value map is built.
- The following keys are recognized (TODO link all this to GoDoc):
- KABUTA_LOG_FILE - log file. If cannot be opened, or missing, defaults to
~/kabuta.log
. This is important, because stdin/stdout/stderr are for communicating with the front-end. Therefore, a file
is needed. - KABUTA_DLV_PATH - path to dlv binary
- KABUTA_DLV_PORT - port on which dlv API server is to listen. If invalid (not a positive integer) or missing, defaults to 8181.
- KABUTA_PATH - its value should be path-separator-separated
- KABUTA_LOG_FILE - log file. If cannot be opened, or missing, defaults to
- Environment variables named same as above keys can override values from the
~/.kabutainit
file
(see above).
TODO
Issues and pull requests (though it's a bit too early for the latter at this stage) are welcome. Or drop me an email at grisha_AT_alum.mit.edu.
If something is not clear, feel free to ask.