Documenting how to debug project-manager project (#7153)

```
sbt:project-manager> withDebug run --debugger
```
This commit is contained in:
Jaroslav Tulach 2023-06-29 07:55:14 +02:00 committed by GitHub
parent 60ef7e0ba3
commit 91f661fd8b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 37 additions and 9 deletions

View File

@ -775,6 +775,7 @@ lazy val `project-manager` = (project in file("lib/scala/project-manager"))
(Compile / run / fork) := true,
(Test / fork) := true,
(Compile / run / connectInput) := true,
commands += WithDebugCommand.withDebug,
libraryDependencies ++= akka ++ Seq(akkaTestkit % Test),
libraryDependencies ++= circe,
libraryDependencies ++= Seq(

View File

@ -404,7 +404,13 @@ withDebug benchOnly --showCompilations -- RecursionBenchmark
Step by step debugging can be triggered as
```
withDebug testOnly --debugger -- *FavoriteTest*
sbt:runtime> withDebug testOnly --debugger -- *FavoriteTest*
```
One can debug `project-manager` code by executing
```
sbt:project-manager> withDebug run --debugger
```
read more about [debugging Java & Enso code](debugger/README.md).

View File

@ -61,16 +61,37 @@ IDE.
Get [NetBeans](http://netbeans.apache.org) version 13 or newer or
[VS Code with Apache Language Server extension](https://cwiki.apache.org/confluence/display/NETBEANS/Apache+NetBeans+Extension+for+Visual+Studio+Code)
and just pass in special JVM arguments when launching the `bin/enso` launcher:
and _start listening on port 5005_ with _Debug/Attach Debugger_ or by specifying
following debug configuration in VSCode:
```bash
enso$ JAVA_OPTS=-agentlib:jdwp=transport=dt_socket,server=y,address=8000 ./built-distribution/enso-engine-*/enso-*/bin/enso --run ./test/Tests/src/Data/Numbers_Spec.enso
Listening for transport dt_socket at address: 8000
```json
{
"name": "Listen to 5005",
"type": "java+",
"request": "attach",
"listen": "true",
"hostName": "localhost",
"port": "5005"
}
```
and then _Debug/Attach Debugger_. Once connected suspend the execution and (if
the Enso language has already been started) choose the _Toggle Pause in GraalVM
Script_ button in the toolbar:
Then it is just about executing following Sbt command which builds CLI version
of the engine, launches it in debug mode and passes all other arguments to the
started process:
```bash
sbt:enso> runEngineDistribution --debug --run ./test/Tests/src/Data/Numbers_Spec.enso
```
Alternatively you can pass in special JVM arguments when launching the
`bin/enso` launcher:
```bash
enso$ JAVA_OPTS=-agentlib:jdwp=transport=dt_socket,server=n,address=5005 ./built-distribution/enso-engine-*/enso-*/bin/enso --run ./test/Tests/src/Data/Numbers_Spec.enso
```
As soon as the debuggee connects and the Enso language starts - choose the
_Toggle Pause in GraalVM Script_ button in the toolbar:
![NetBeans Debugger](https://user-images.githubusercontent.com/26887752/209614191-b0513635-819b-4c64-a6f9-9823b90a1513.png)

View File

@ -230,7 +230,7 @@ public final class Builtins {
/**
* Returns a list of supported builtins.
*
* <p>Builtin types are marked via @BuiltinType annotation. THe metdata file represents a single
* <p>Builtin types are marked via @BuiltinType annotation. The metadata file represents a single
* builtin type per row. The format of the row is as follows: <Enso name of the builtin
* type>:<Name of the class representing it>:[<field1>,<field2>,...] where the last column gives a
* list of optional type's fields.