Commit graph

64 commits

Author SHA1 Message Date
Ben Jackson
e573c2fd9f Print server stderr to the GUI 2019-01-12 15:14:06 +00:00
Ben Jackson
ea1962e11b Use a short timeout for closedown 2018-12-20 16:54:55 +00:00
Ben Jackson
af338669f3 Add timeout for requests. 2018-12-20 15:10:24 +00:00
Ben Jackson
673de95283 Updates for latest Python debug adapter
They moved the location of the main application.

But also:

- ignore multiple responses for the same request
- ignore protocol violations for variablesReference (assume 0)
- ignore protocol violations for missing 'name' (assume basename of
path)
2018-12-20 13:42:58 +00:00
Ben Jackson
14603ae72f Support java debugging
The java architecture is a little different:

- the debugger is a jdt.ls extension bundle.
- to start the server, you send a startDebugSession command to jdt.ls
- this returns a tcl port to connect to for DAP

Loading of jdt.ls and the extension are out of scope for vimspector
currently and instead you can tell it to ask you for a port to connect
to.

After connexting to that port, vimspector works as normal.

To support TCP/IP was pretty simple: we provide the same API from
vimscript as the job-based (stdin/out) comms layer, but instead just
directly use a channel.

The only wrinkle was that the java debug adapter broke the protocol on
runInTerminal and didn't return a 'cwd', so we make one up.
2018-12-20 00:29:45 +00:00
Ben Jackson
256579c4d8 Imrpove console evaluation somewhat. Fix restart bug not resetting connection in the console view 2018-12-19 01:33:21 +00:00
Ben Jackson
87db1e3478 Properly responsd to server reverse-request 2018-12-19 00:44:33 +00:00
Ben Jackson
83ecbe1aed Improve cleanup by forcefully closing the tab. This could leave unsaved buffers hidden, but it's not easy to know what better to do. Mainly issues happen due to our own buffers being marked as modified for some rason. TODO: fix that instead 2018-12-16 19:14:26 +00:00
Ben Jackson
62e9335a10 Support runInTerminal (sort of) 2018-12-16 19:13:10 +00:00
Ben Jackson
08eed4ff15 Update the test/example config file with vars 2018-06-10 23:35:33 +01:00
Ben Jackson
79b25c0860 Allow for variable expansion in configuration
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.
2018-06-10 23:31:20 +01:00
Ben Jackson
3f9bc6f921 Re-add user-requested-breakpoints when resetting
This adds the markers back to any buffers that were open beforehand and
used to request line breakpoints.
2018-06-10 18:34:37 +01:00
Ben Jackson
b72bc7dfbf Use prompt buffer for Console
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.
2018-06-10 18:32:16 +01:00
Ben Jackson
b9ceb5e8ec Fix the restart button. You can't choose another configuration, but that appears impossible 2018-06-05 23:13:39 +01:00
Ben Jackson
1f4f1a1fcc Preserve expand/collapse state of variables and watches
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.
2018-06-05 21:49:29 +01:00
Ben Jackson
553ad95404 Simplify vim options changes 2018-06-03 14:29:51 +01:00
Ben Jackson
040746409b Put the watches between the vars and the scopes 2018-06-03 00:36:46 +01:00
Ben Jackson
fa775f4499 Separate watches and scopes
They are related (and share code) but make more sense separately
2018-06-03 00:20:07 +01:00
Ben Jackson
298ff8cd9c Allow remote attach to gdbserver without pid picking 2018-06-01 19:55:32 +01:00
Ben Jackson
65e2a50d28 Yet more hacking. This sort of makes it work for rust 2018-05-29 02:15:18 +01:00
Ben Jackson
b6a9cba52e Support the bash debugger
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.
2018-05-29 00:39:37 +01:00
Ben Jackson
ba0c11392d Fix python debugger again 2018-05-28 22:22:00 +01:00
Ben Jackson
46cdedc648 Trivial support for function breakpoints
You can't see them and you can't disable/cancel them.
2018-05-28 19:36:50 +01:00
Ben Jackson
9baea25c46 Start to refactor breakpoints into different types
This basically stores line breakpoints as a map by file name. Soon to
come: function breakpoints and others.
2018-05-28 19:11:29 +01:00
Ben Jackson
979e796bf4 SOrt out the breakpoints TODO. There's still a lot to do in that space 2018-05-28 16:32:41 +01:00
Ben Jackson
bac30acff3 Refactor config file to set adapter properties independently
This can later be extended to set adapter properties globally.
2018-05-28 16:11:11 +01:00
Ben Jackson
9e0b68330e Tidy up the buffers and don't switch on new 2018-05-28 15:48:51 +01:00
Ben Jackson
f9ecf5f05d Move the output window to its own space
And separate all the different channels into their own buffers. Use the
WinBar to select between them.
2018-05-28 15:14:41 +01:00
Ben Jackson
eb11712cc1 Make sure to close down cleanly
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.
2018-05-28 13:49:40 +01:00
Ben Jackson
afe4c0db77 Tidy breakpoints 2018-05-28 13:23:31 +01:00
Ben Jackson
539b6d5c13 Don't send configurationDone each time we set breakpoints 2018-05-28 11:18:18 +01:00
Ben Jackson
403b90a961 Reintroduce width 2018-05-28 11:17:58 +01:00
Ben Jackson
5ed9a06ed5 Move the thread handling into the stack frame handling
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.
2018-05-28 02:34:05 +01:00
Ben Jackson
0a19048311 Don't try to expand variables that are not expandable 2018-05-27 23:59:36 +01:00
Ben Jackson
b02d35e78d Very hacky: Support for attach
This introduced more hacks than it should. In particular, the sequence
about stack trace requesting became very messy. When we attach, we don't
instantly get a stopped event. This required making the Pause command
actually work (sort of). In this case we often won't have a proper
current thread.

Instead we sort of request all threads whenever we get a thread event,
thought his is horribly hacky and we should really just use the thread
event as-is. We then attempt to pause ALL threads on pause and continue
requests when we don't know the current thread.

Another issue is that when pausing it's likely we don't have the source
location info for the pause location (something like select() or
whatever), so we only set the current frame to the lowest one we have
source for. This sort of roughly matches what you want.

This whole thing makes it clear that threads and stack trace in separate
panes makes no sense. We need to replicate the hierarchy in the
variables view for threads and stack traces.
2018-05-27 23:40:37 +01:00
Ben Jackson
7600e1e652 Add a reset command to undo all the UI and reset everything 2018-05-27 21:40:31 +01:00
Ben Jackson
6aecfb969b Very basic balloon support.
This is a huge hack, setting it manually and never resetting it. Just
displaying the value (no breakdown) etc.

I'm tempted to drop this functionality altogether as it is of limited
use when you have the locals and watch windows.
2018-05-27 20:23:25 +01:00
Ben Jackson
7e76c9763d Name the buffers so it's clearer what they do
This actually restricts us to a single debugging pane, but that's really
already a restriction of the vim-side (only one job, etc.). Support for
multiple sessions isn't a priority.
2018-05-27 18:34:39 +01:00
Ben Jackson
3f73d1c2f8 Allow deleting watches and improve expansion
Now scopes and watch results can be expanded/collapsed. Locals still
default to being expanded, but watches do not.
2018-05-27 18:19:07 +01:00
Ben Jackson
533b2aa0d5 Very basic support for watch expressions
You can currently only add them, not remoove them and you have to pass
the expression in the function call, but once added the variable
breakdown works nicely.
2018-05-27 16:59:06 +01:00
Ben Jackson
dd17f3f6f6 If there's only one config, just use it 2018-05-27 13:41:36 +01:00
Ben Jackson
73f8a66d2c Reset the connection when the channel closes 2018-05-27 13:41:23 +01:00
Ben Jackson
dbef05b9a5 support restarting via calling Launch again (todo: restart button doesn't work) 2018-05-27 00:04:56 +01:00
Ben Jackson
eeabd00b4a Handle debug and terminated events
Somewhat at least.
2018-05-26 22:03:39 +01:00
Ben Jackson
45a8176de3 remove pointless bothering message 2018-05-26 20:41:57 +01:00
Ben Jackson
7d3af848cf Separate out the display of 'requested' and 'applied' breakpoints
This is a mess, with a load of duplication, but it's a step. When you
request a breakpoint, we add one (in state ENABLED). You can then toggle
it again to change to DISABLED. And once more to delete it.

Once we start the debug server, that all changes and we just start
sending the breakpoints directly to the server and updating based on the
responses. This is far from ideal and somewhat jarring, but this
approach allows me to play around with ideas about what the user
experience should look like.
2018-05-26 19:54:45 +01:00
Ben Jackson
9d9c2214f3 Breakpoints returned from servers rarely have source set
For line-breakpoints we already know it, so just use what we said
originally. For method breakpoints, we have no clue. While some servers
return a line, it could be in any file, so we just ignore them.
2018-05-26 19:08:59 +01:00
Ben Jackson
d814091692 Support for legacy servers that use deprecated api? 2018-05-26 18:52:33 +01:00
Ben Jackson
76f26551fb Probably not working: allow unverified breakpoints 2018-05-26 18:52:09 +01:00
Ben Jackson
2ffea55e93 Store the current launch configuration rather than pass it arround
This allows me to play around with the launch sequence a bit more
freely, though it does lead to a cacheing issue.
2018-05-26 18:50:47 +01:00