We expand environment variables, ~ and workspaceRoot. The latter is to
match vscode and typical launch configs. As we don't know what the
workspeace root might be, we use the location of the .vimspector.json.
Like VSCode does, compbine console and stdout, and allow you to enter
commands in the console. It's all a bit janky right now and the
insertion point isn't ideal (as not all output is interactive) and some
output is asynchronous via a somewhat different channel.
This is starting to get horribly hacky and needs refactoring into
proper classes. Expandable variables now have the following additional
magic properties:
- '_expanded': True (expanded), False (collapsed), none = no preference
- '_variables': Current of child variables
- '_old_variables': The previous state of the '_variables' list when
refreshing
Remember that '_result' (the magic property of a watch expression) is
also treated like an expandable variable, so also has these magic
parameters.
Vim seems to insist that a buffer has at least one line. This means that
the first line set in the buffer object has to be a special case. Sigh.
Create a method to wrap that up.
The advantage of this one is that it has globals and statics in the
variables and runs directly in lldb. It can also show disassembly,
though we don't yet support that.
The disadvantage is that this is yet another plugin that plays fast and
loose with the protocol, so we have to add a bunch more gets.
This required working around some sort of bug where the server returns
an invalid content length. Either that or we are somehow processing the
same message twice with additional escaping? It's really strange.
This involves some horrible forceful reading on exit to ensure that we
get a response to the disconnect request. This ensures that any debugee
is killed cleanly.
This shows stack traces as children of a thread, removing one of the
UI splits. However, we still have the somewhat awkward concepts of
"current" thread and "current" stack frame. These are messy and
incredibly fiddly. And in any case, probably wrong _most_ of the time.