Skip to content

Commit 8601b58

Browse files
authored
Mvp release docs2 (#15)
* move dap library readme to dap folder * add new top level readme * add links for components ; more consistent look * add missing vscode extension npm install step * add videos for setup * Update README.md * make VSCode reference more specific * fix typo
1 parent 5bc64b7 commit 8601b58

7 files changed

+72
-3
lines changed

README.md

Lines changed: 67 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,73 @@
1-
# dap <img src="https://user-images.githubusercontent.com/875324/235317448-1cf2d543-40a8-4eaa-b765-6576ddd7f84f.png" width="5%" />
1+
# Haskell ESTGi Debugger
22

3-
A [Debug Adaptor Protocol](https://microsoft.github.io/debug-adapter-protocol) (DAP) library.
3+
This repository contains the components for Haskell debugging based on the Debug Adapter Protocol ([DAP](https://microsoft.github.io/debug-adapter-protocol)).
44

5-
This library can be used for constructing debug adaptors for any programming language.
5+
* [`dap/`](dap/): Language and backend independent simple DAP library
6+
* [`dap-estgi-server/`](dap-estgi-server/): DAP server for External STG Interpreter (DAP-ESTGi)
7+
* [`dap-estgi-vscode-extension/`](dap-estgi-vscode-extension/): VSCode extension to support Haskell debugging using DAP-ESTGi server
68

9+
## Overview
710

11+
The `dap-estgi-vscode-extension` turns VSCode into a Haskell debugger.
12+
VSCode offers a nice debugger UI while the debugger features are provided by the External STG Interpreter DAP Server.
813

14+
```mermaid
15+
flowchart LR
16+
subgraph User Interface
17+
A(VSCode) -.- |Plugin API| B(DAP ESTGi Extension)
18+
end
19+
B <-->|DAP via network| C(DAP ESTGi Server)
20+
subgraph Debugger
21+
C -.- |HS library API| D(External STG Interpreter)
22+
end
923
24+
```
25+
26+
The `dap-estgi-server` and `dap-estgi-vscode-extension` are application specific components, while the
27+
`dap` library is designed to be application independent to support any project that needs a simple DAP framework.
28+
29+
## Setup
30+
31+
1. VSCode setup
32+
Enable `allow breakpoints everywhere` option in VSCode settings.
33+
2. Run `dap-estgi-extension`
34+
* Run: `(cd dap-estgi-vscode-extension ; npm install)`
35+
* Open `dap-estgi-vscode-extension` folder by using the `Files/Open Folder` menu.
36+
* Open the `src/extension.ts` file.
37+
* Press F5 to run the extension in a new VSCode [Extension Development Host] window.
38+
3. Start `dap-estgi-server`
39+
`(cd dap-estgi-server ; stack run)`
40+
4. Compile debuggee program with GHC-WPC using stack
41+
* Add the following lines to debuggee's `stack.yaml`:
42+
```
43+
# use custom ext-stg whole program compiler GHC
44+
compiler: ghc-9.2.7
45+
compiler-check: match-exact
46+
ghc-variant: wpc
47+
setup-info:
48+
ghc:
49+
linux64-custom-wpc-tinfo6:
50+
9.2.7:
51+
url: "https://github.com/grin-compiler/foundation-pak/releases/download/ghc-9.2.7/ghc-9.2.7-x86_64-unknown-linux.tar.xz"
52+
macosx-custom-wpc:
53+
9.2.7:
54+
url: "https://github.com/grin-compiler/foundation-pak/releases/download/ghc-9.2.7/ghc-9.2.7-x86_64-apple-darwin.tar.xz"
55+
```
56+
* Run: `stack build`
57+
5. Open debuggee program in VSCode [Extension Development Host]
58+
* Open debugge project folder by using the `Files/Open Folder` menu.
59+
* Select the debug view on the side bar
60+
* Click to `create a launch.json file`, then select `Haskell DAP ESTGi`
61+
* Press F5 or the `Play` button to start debugging
62+
63+
## Setup in video
64+
1. VSCode setup
65+
![](docs-images/dap-01-vscode-setup-5fps.avif)
66+
2. Run `dap-estgi-extension`
67+
![](docs-images/dap-02-run-dap-estgi-extension-5fps.avif)
68+
3. Start `dap-estgi-server`
69+
![](docs-images/dap-03-start-dap-estgi-server-5fps.avif)
70+
4. Compile debuggee program with GHC-WPC using stack
71+
![](docs-images/dap-04-compile-debuggee-5fps.avif)
72+
5. Open debuggee program in VSCode [Extension Development Host]
73+
![](docs-images/dap-05-open-debuggee-in-vscode-5fps.avif)

dap/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# dap <img src="https://user-images.githubusercontent.com/875324/235317448-1cf2d543-40a8-4eaa-b765-6576ddd7f84f.png" width="5%" />
2+
3+
A [Debug Adaptor Protocol](https://microsoft.github.io/debug-adapter-protocol) (DAP) library.
4+
5+
This library can be used for constructing debug adaptors for any programming language.
113 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
60.4 KB
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)