Skip to content

Commit

Permalink
moving to cdt gdb adapter
Browse files Browse the repository at this point in the history
fix doctor cmd test

test node 16

try node 18

remove out delete

try rm set output

modify github output

another try at test result

test again

rm comment code
  • Loading branch information
brianignacio5 committed Mar 6, 2024
1 parent d64c530 commit 110b256
Show file tree
Hide file tree
Showing 38 changed files with 5,784 additions and 210 deletions.
5 changes: 4 additions & 1 deletion .github/actions/idf/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ export PY_PKGS=$(python -m pip list --format json)
yarn
yarn lint
Xvfb -ac :99 -screen 0 1920x1080x16 & sleep 2 & yarn test
echo ::set-output name=result::$(cat ./out/results/test-results.xml)
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
echo "result<<$EOF" >> $GITHUB_OUTPUT
echo "$(cat ./out/results/test-results.xml)" >> $GITHUB_OUTPUT
echo "$EOF" >> $GITHUB_OUTPUT

rm -r .vscode-test
9 changes: 3 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Clone Repository
uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: "recursive"

- name: Setup Node.js 14
uses: actions/setup-node@v2
- uses: actions/setup-node@v4
with:
node-version: "14"
node-version: 18

- name: Install Node Dependencies
run: yarn
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/ui-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Clone Repository
uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: "recursive"

Expand Down
46 changes: 44 additions & 2 deletions docs/DEBUGGING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,17 @@
The Visual Studio Code uses `.vscode/launch.json` to configure debug as specified in [Visual Studio Code Debugging](https://code.visualstudio.com/docs/editor/debugging#_launch-configurations).

We recommend using our Eclipse CDT GDB configuration to debug your ESP-IDF projects, but you can configure launch.json for any GDB debugger extension like [Microsoft C/C++ Extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools) and [Native Debug](https://marketplace.visualstudio.com/items?itemName=webfreak.debug). The ESP-IDF Debug adapter will be deprecated and removed in the next major release.
We recommend using our Eclipse CDT GDB Adapter configuration to debug your ESP-IDF projects, but you can configure launch.json for any GDB debugger extension like [Microsoft C/C++ Extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools) and [Native Debug](https://marketplace.visualstudio.com/items?itemName=webfreak.debug). The ESP-IDF Debug adapter will be deprecated and removed in the next major release.

Our extension implements a `ESP-IDF: Peripheral View` tree view in the `Run and Debug` view which will use the SVD file defined in the `IDF SVD File Path (idf.svdFilePath)` configuration setting to be defined in the [settings.json](../SETTINGS.md) to populate a set of peripherals registers values for the active debug session target. You could find Espressif SVD files from [Espressif SVD](https://github.com/espressif/svd).

If `initCommands`, `gdbinitFile` or `initGdbCommands` are defined in launch.json, make sure to include the following commands for debug session to properly work as shown in [JTAG Debugging with command line](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/jtag-debugging/using-debugger.html#command-line).

## Using the Eclipse CDT GDB Debug Adapter

The Eclipse CDT team have published a GDB debug adapter as NPM package which we include in our extension dependencies. For more information about the debug adapter please review [CDT-GDB-Adapter Github Repository](https://github.com/eclipse-cdt-cloud/cdt-gdb-adapter). The arguments in launch.json are
The Eclipse CDT team have published a GDB debug adapter as NPM package which we include in our extension dependencies. For more information about the debug adapter please review [CDT-GDB-Adapter Github Repository](https://github.com/eclipse-cdt-cloud/cdt-gdb-adapter).

The basic arguments in launch.json are

```JSON
{
Expand All @@ -38,6 +42,44 @@ The Eclipse CDT team have published a GDB debug adapter as NPM package which we
}
```

where `program` and `gdb` can be resolved by extension. Some additional arguments you might use are:

- `runOpenOCD`: (Default: true). Run extension openOCD Server.
- `verifyAppBinBeforeDebug`: (Default: false) Verify that current ESP-IDF project binary is the same as binary in chip.
- `logFile`: Absolute path to the file to log interaction with gdb.
- `verbose`: Produce verbose log output.
- `environment`: Environment variables to apply to the ESP-IDF Debug Adapter. It will replace global environment variables and environment variables used by the extension.

```json
"environment": {
"VAR": "Value"
}
```

- `imageAndSymbols`:

```json
"imageAndSymbols": {
"symbolFileName": "If specified, a symbol file to load at the given (optional) offset",
"symbolOffset": "If symbolFileName is specified, the offset used to load",
"imageFileName": "If specified, an image file to load at the given (optional) offset",
"imageOffset": "If imageFileName is specified, the offset used to load"
}
```

- `target`: Configuration for target to be attached.

```json
"target": {
"type": "The kind of target debugging to do. This is passed to -target-select (defaults to remote)",
"host": "Target host to connect to (defaults to 'localhost', ignored if parameters is set)",
"port": "Target port to connect to (defaults to value captured by serverPortRegExp, ignored if parameters is set)",
"parameters": "Target parameters for the type of target. Normally something like localhost:12345. (defaults to `${host}:${port}`)"
}
```

Other arguments please review this extension's package.json `gdbtarget` debugger contribution.

## Use Microsoft C/C++ Extension to Debug

The user can also use [Microsoft C/C++ Extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools) to debug, the community recommend this launch.json configuration:
Expand Down
2 changes: 0 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ const del = require("del");
const vsce = require("vsce");
const nls = require("vscode-nls-dev");
const { readdirSync, statSync } = require("fs");
const { readJSON, writeJSON } = require("fs-extra");
const { join } = require("path");
const glob = require("glob");

Expand All @@ -34,7 +33,6 @@ languagesDirs.forEach((langDir) => {
function clean(done) {
del([
"dist/**",
"out/**",
"package.nls.*.json",
"*.vsix",
"report.json",
Expand Down
21 changes: 12 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1481,8 +1481,7 @@
},
{
"type": "gdbtarget",
"label": "GDB Target",
"program": "./node_modules/cdt-gdb-adapter/dist/debugTargetAdapter.js",
"label": "Eclipse GDB Target",
"runtime": "node",
"configurationAttributes": {
"launch": {
Expand All @@ -1496,6 +1495,11 @@
"type": "string",
"description": "Working directory (cwd) to use when launching gdb. Defaults to the directory of the 'program'"
},
"runOpenOCD": {
"type": "boolean",
"description": "Run OpenOCD Server",
"default": true
},
"environment": {
"additionalProperties": {
"type": [
Expand Down Expand Up @@ -1934,14 +1938,12 @@
"type": "gdbtarget",
"request": "attach",
"name": "Eclipse CDT GDB Adapter",
"program": "${workspaceFolder}/build/${command:espIdf.getProjectName}.elf",
"initCommands": [
"set remote hardware-watchpoint-limit 2",
"mon reset halt",
"maintenance flush register-cache",
"thb app_main"
],
"gdb": "${command:espIdf.getXtensaGdb}",
"target": {
"port": "3333"
}
Expand All @@ -1955,14 +1957,12 @@
"type": "gdbtarget",
"request": "attach",
"name": "Eclipse CDT GDB Adapter",
"program": "^\"\\${workspaceFolder}/build/\\${command:espIdf.getProjectName}.elf\"",
"initCommands": [
"set remote hardware-watchpoint-limit 2",
"mon reset halt",
"maintenance flush register-cache",
"thb app_main"
],
"gdb": "^\"\\${command:espIdf.getXtensaGdb}\"",
"target": {
"port": "3333"
}
Expand Down Expand Up @@ -2052,14 +2052,15 @@
"@types/ws": "^7.2.5",
"@types/xml2js": "^0.4.11",
"@types/yauzl": "^2.9.1",
"@vscode/debugadapter": "^1.53.0",
"@vscode/debugadapter": "^1.65.0",
"@vscode/debugadapter-testsupport": "^1.51.0",
"@vscode/debugprotocol": "^1.53.0",
"@vscode/debugprotocol": "^1.65.0",
"@vscode/extension-telemetry": "0.4.8",
"@vscode/test-electron": "^2.1.2",
"@vue/compiler-sfc": "^3.3.4",
"bulma": "^0.9.3",
"chai": "^4.3.4",
"copy-webpack-plugin": "^12.0.2",
"css-loader": "^3.1.0",
"d3-scale": "^4.0.2",
"file-loader": "^6.2.0",
Expand All @@ -2079,6 +2080,7 @@
"reflect-metadata": "^0.1.13",
"sass": "^1.49.8",
"sass-loader": "^10",
"string-replace-loader": "^3.1.0",
"style-loader": "^3.3.1",
"ts-loader": "^9.4.4",
"typescript": "^5.2.2",
Expand All @@ -2098,7 +2100,6 @@
"assert": "^2.1.0",
"axios": "^1.6.0",
"bignumber.js": "^9.0.1",
"cdt-gdb-adapter": "^0.0.32",
"del": "^4.1.1",
"es6-promisify": "^6.0.0",
"follow-redirects": "^1.15.4",
Expand All @@ -2114,9 +2115,11 @@
"plotly.js-dist-min": "^2.26.1",
"postcss": "^8.4.31",
"sanitize-html": "^2.7.0",
"serialport": "^12.0.0",
"stream-browserify": "^3.0.0",
"tar-fs": "^2.0.0",
"tree-kill": "^1.2.2",
"utf8": "^3.0.0",
"vscode-languageclient": "^5.2.1",
"vscode-languageserver": "^5.2.1",
"vscode-nls": "^4.0.0",
Expand Down
Loading

0 comments on commit 110b256

Please sign in to comment.