docs: document recompiling V itself with debug info, debugging tests, and a tip for vscode (#10358)

pull/10376/head
Andreas Heissenberger 2021-06-07 10:09:07 +02:00 committed by GitHub
parent 8a497080b3
commit eef445508f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View File

@ -3860,6 +3860,11 @@ This will make V produce the `file.c` then stop.
If you want to see the generated C source code for *just* a single C function,
for example `main`, you can use: `-printfn main -o file.c`.
To debug the V executable itself you need to compile from src with `./v -g -o v cmd/v`.
You can debug tests with for example `v -g -keepc prog_test.v`. The `-keepc` flag is needed,
so that the executable is not deleted, after it was created and ran.
To see a detailed list of all flags that V supports,
use `v help`, `v help build` and `v help build-c`.

View File

@ -81,6 +81,9 @@ or create the file `.vscode/launch.json`:
}
```
**Optional:** use `"program": "${fileDirname}/${fileBasenameNoExtension}"` to debug
any current open source file with an existing binary with the same name but without any extention.
### Usage
To allow your compiled application to be debugged.