Commit graph

381 commits

Author SHA1 Message Date
Ben Jackson
30eec0d93c Fix variable substitution for multiple defaulted vars
The problem was that the python regex engine is strictly left-to-right,
so matching `[^}]|\\}` against \\}} meant that the `\\` was consumed by
the left of the `|`. The solution is to just switch them around.

Also add a way to run python tests from within vim, so we can actually
test this stuff.
2021-02-06 20:55:24 +00:00
Ben Jackson
205eb7cdb3
Merge branch 'master' into master 2021-01-09 10:33:38 +00:00
Ben Jackson
d52eb3a6e9 Fix thread state and PC for starting node app
The problem is the sequence of events sent by the debug adapter.
Vimspector requests threads:

* When the initialisation exchange completes (requests all threads)
* Whenever a thread event is received
* whenever a stopped event is received.

If any of those happens while any other request is in progress, we cache
the request and handle it later. The latest request is processed when
the response to the outstanding request is received.

The problem is if the event is a stopped event, it is the handling of
the threads request that actually sets the thread state internally to
stopped. In a sequence where the first event is a stopped event, we end
up discarding the stopped event. like:

1. Stopped event (thread 1 = stopped) (request threads)
2. Initialisation complete (cache request)
3. threads response received (discard response and process cached request)
4. response received (but forgotten about the stopped event).

The solution is to always process the thread response, even if we send
the cached request. To avoid flicker, we don't draw the screen, or
expand any threads/stacks in the case where we're sending a cached
request.
2021-01-08 11:35:01 +00:00
Ben Jackson
38ed75dda7
Merge branch 'master' into master 2021-01-06 09:56:40 +00:00
Ben Jackson
0ad826704b
Merge branch 'master' into master 2021-01-06 09:54:16 +00:00
Gabriel Filion
7bd22d2bbd bump debugpy gadget to version 1.2.1
1.2.1 is, as of this commit, the most recent version of the gadget.

The version currently used, 1.0.0b12 is not compatible with Python 3.9:
the build errors out on missing arguments for _PyEval_EvalFrameDefault.

Python 3.9 is the version of Python that will be shipped with the
upcoming debian release.

Support for 3.9 was merged in before the final 1.0.0 version. So,
upgrading the gadget will bring in python 3.9 support
2021-01-02 15:46:53 -05:00
Allan Guigou
47c404f823 Allow a gadget to specify a custom extension path
When installing a custom gadget not officially supported by vimspector the
default extension path is 'extension', this works for vscode extensions but
does not support some debug adapters. This commit gives the ability to change
that default extension path by specifying 'extension_path' within the gadget
installer file.

Installing 'cust_adapter' would use the extension path 'adapter' rather
than 'extension' (ie ${gadgetDir}/cust_adapter/${version}/root/adapter)

{
  "cust_adapter": {
    "download": { ... },
    "all": {
      "extension_path": "adapter",
      "adapters": { ... }
    }
  }
}
2020-12-24 14:55:40 -05:00
Ben Jackson
0942aa4523 Fix docker example for python
The example was was using 'launchCommand' which is not valid according
to the schema; it should be 'runCommand'.

But also, it never really worked. Vimspector would start the "adapter"
(in this case, try and connect to the TCP port) before running the
"prepare" commands, wich in this case would actually start debugpy
listening. So to solve that we run the prepare commands earlier.
Hopefully this won't cause a regression for Java and C++ remote attach,
which we don't really have tests for.

Finally, due to the way docker works, when you forward a port and
nothing is listening on it, docker _accepts_ the connection then
immediately drops it. This is _super_ annoying meaning that it looks to
vimspector liek the server instantly dies if it takes nonzero time for
the remote commands to open the port. So to solve this we add loaunch
and attach delays which can be configured in the adapter config. This
actually solves a prolem where the java debugger just takes agest to
attach on remote launch too.

(Finally, finally...) updated the vimspector schema to represent
the real launch/attach remote configuration, which was incorrectly
spec'd at the adapter level, but it's actually per launch/attach block.
2020-12-22 15:45:26 +00:00
Ben Jackson
f59ba048cb
Merge branch 'master' into master 2020-12-19 18:30:02 +00:00
Yatao Li
f20c4c9725 fix linter errors 2020-12-19 22:35:12 +08:00
Yatao Li
66130389c5 code format fixes, update docs 2020-12-15 16:25:26 +08:00
cposture
b65d9536ad update gadgets vscode-go version 2020-12-15 00:22:35 +08:00
Yatao Li
28c5534704 language list 2020-12-14 22:57:32 +08:00
Ben Jackson
8261cde3c9 Don't copy the environment to update it
This causes problems on windows, and is wasteful anyway. The subprocess
will pick up the environment from its parent.
2020-12-05 16:42:07 +00:00
Ben Jackson
2eac9ddff8 Print failure when watch expression errors 2020-12-02 15:26:30 +00:00
Ben Jackson
8e2d352eb8 Fix local adapter specs
Somehow we lost the ability to define adapters in the local
.vimspector.json, I think when GetConfigurations was added.

Put that feature back.
2020-11-30 10:19:02 +00:00
Ben Jackson
e15c50a4f4 Don't request strack trace if the thread isn't stopped 2020-11-28 00:17:42 +00:00
Ben Jackson
a9d0ebde0b Add mapping for Focus, and make focusing a stack frame focus the thread 2020-11-22 14:13:15 +00:00
Ben Jackson
82307ff1ba Correctly handle the 'continue' response when continuing a specific thread 2020-11-22 14:13:15 +00:00
Ben Jackson
8801c2dac4 Fix pause/continue of individual threads
work around buggy java server sending invalid threads response.

java server supports this separate threads running/paused as a test
case.
2020-11-22 14:13:14 +00:00
Ben Jackson
e1c1347bdd Fix lint 2020-11-22 14:13:14 +00:00
Ben Jackson
c769e8a479 Fix up the tests to work in linux container too 2020-11-22 14:13:14 +00:00
Ben Jackson
53b1d12447 Allow setting the current thread, use a sign to highlight the line with the current thread 2020-11-22 14:13:14 +00:00
Ben Jackson
8e3a734141 Support continued event properly 2020-11-22 14:13:14 +00:00
Ben Jackson
0f0d684e92 FixUp: comment about why we apply thread state in consume_threads 2020-11-22 14:13:14 +00:00
Ben Jackson
f0785c11f2 Allow pausing individual threads (in theory) 2020-11-22 14:13:14 +00:00
Ben Jackson
a5d66a7477 Correctly track and now actually report running/paused status
It's quirky, we have to pass the stopped event to LoadThreads so that it
can correctly work out the state of any _newly_ added threads. We now
also correctly apply the allThreadsStopped=False behaviour where you
must not allow expansion of such threads (in theory, that's untested).
2020-11-22 14:13:14 +00:00
Ben Jackson
2399a79cae start to track individual thread state 2020-11-22 14:13:14 +00:00
Ben Jackson
e9e0e9e5b9 Test for new thread creation
- don't clear the stack trace on continue - track running status
  properly (ish)
- mark threads (running) when the app is executing
- indicate the "current" thread with a different icon

TODO:
- allow user to specify current thread?
- track running status of threads individually?
- allow to pause/continue specific threads?
2020-11-22 14:13:14 +00:00
Ben Jackson
07ec08e664 Fix clearing temp breakpoints - ensure that the isngs are undisplayed 2020-11-22 13:25:10 +00:00
Ben Jackson
87ce1734ea Update vscode-go to latest version 2020-11-22 12:31:21 +00:00
Ben Jackson
b36f9e893a Work around neovim WinBar rendering bug 2020-11-19 23:29:13 +00:00
Ben Jackson
47c2cef2a1 Use a tag for tclpro to avoid installing every time 2020-11-16 21:17:36 +00:00
Ben Jackson
cd3b5f5baa Update mono debug; even though it doesn't work 2020-11-16 21:17:22 +00:00
Ben Jackson
5b88837919 Print the correct version for a git tag 2020-11-16 20:14:39 +00:00
Eduardo Mezêncio
85865e0012 Add regression tests for lua support
Change Dockerfile to install lua, luajit and love and also to install
nodejs 12 needed to build the lua debug adapter. Create the
love-headless test in support/test/lua to test love without an x server.
2020-11-16 15:08:55 -03:00
Eduardo Mezêncio
2819e224e7 Add lua support through local-lua-debugger-vscode
Add the lua adapter to gadgets.py and installer.py, update the README.md
file and create basic tests using lua, luajit and love.
2020-11-14 19:34:15 -03:00
mergify[bot]
5ae3d9f336
Merge branch 'master' into codelldb-default 2020-11-09 22:41:50 +00:00
Ben Jackson
2225735b80 Recommend CodeLLDB 2020-11-09 22:23:37 +00:00
Ben Jackson
fb86ef924b Update netcoredbg 2020-11-09 21:57:47 +00:00
Emmanuel Thompson
d5b9411256 Add a GetConfigurations function 2020-11-06 12:05:14 -05:00
Ben Jackson
80985148e7 Add "run to cursor" support
We add a 'temporary' option to line breakpionts and try and clear any
temporary breakpionts on the line we end up stopping on. This might not
be art, but _probably_ works in almost all cases that matter.

it's a bit hacky the way we have to push the reason around, but we don't
know where we stopped until we actually get the stack trace response and
SetCurrentFrame

Move temporary breakpionts to match server response

Also delete any existing ones when adding a new one and add tests for
run-to-cursor.

Only continue after we successfully set the breakpoints. This makes it
work in go
2020-10-23 22:53:04 +01:00
Ben Jackson
0d112d70a0 Add SetLineBreakpoint and ClaerLineBreakpoint APIs
These are useful for running tests (i.e. ensure there's a breakpiont at
the start of the test) and/or other programmatic usages.

They will also be needed for setting temporary breakpionts.
2020-10-17 22:40:08 +01:00
Camilo Schoeningh
ea36b60a07
vscode-go: Update version and use new repository.
As of June 2020, the vscode-go repository has moved to https://github.com/golang/vscode-go.
2020-10-14 21:21:11 +02:00
Ben Jackson
f3c5944dd2 Java: Set cwd by default 2020-10-14 15:26:54 +01:00
Ben Jackson
1b9763a4fc Minor improvements to console usage
Display failures and stop adding random text which makes the (very
useful) CodeLLDB interface look messy
2020-10-10 16:20:55 +01:00
Ben Jackson
16f22b396f Fix breakpoint event
Few problems:
 - we were passing a dict instead of a list of breakpoints
 - if the breakpoint had a source which was {} we crashed
 - we didn't support the 'removed' event
2020-10-10 16:04:46 +01:00
Ben Jackson
bd09206caf While debugging, use the correct path for breakpoints 2020-09-27 22:47:22 +01:00
Ben Jackson
b2f41643f4 Add double-click to expand/collapse 2020-09-27 13:14:09 +01:00
Ben Jackson
b34ccd679d Fix ambiwidth=double again and make sure it doesn't break again 2020-09-25 16:36:19 +01:00