Skip to content

Commit 110b256

Browse files
committed
moving to cdt gdb adapter
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
1 parent d64c530 commit 110b256

38 files changed

+5784
-210
lines changed

.github/actions/idf/entrypoint.sh

+4-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ export PY_PKGS=$(python -m pip list --format json)
1919
yarn
2020
yarn lint
2121
Xvfb -ac :99 -screen 0 1920x1080x16 & sleep 2 & yarn test
22-
echo ::set-output name=result::$(cat ./out/results/test-results.xml)
22+
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
23+
echo "result<<$EOF" >> $GITHUB_OUTPUT
24+
echo "$(cat ./out/results/test-results.xml)" >> $GITHUB_OUTPUT
25+
echo "$EOF" >> $GITHUB_OUTPUT
2326

2427
rm -r .vscode-test

.github/workflows/ci.yml

+3-6
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,12 @@ jobs:
1313
runs-on: ubuntu-latest
1414

1515
steps:
16-
- name: Clone Repository
17-
uses: actions/checkout@v2
16+
- uses: actions/checkout@v4
1817
with:
1918
submodules: "recursive"
20-
21-
- name: Setup Node.js 14
22-
uses: actions/setup-node@v2
19+
- uses: actions/setup-node@v4
2320
with:
24-
node-version: "14"
21+
node-version: 18
2522

2623
- name: Install Node Dependencies
2724
run: yarn

.github/workflows/ui-test.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ jobs:
1313
runs-on: ubuntu-latest
1414

1515
steps:
16-
- name: Clone Repository
17-
uses: actions/checkout@v2
16+
- uses: actions/checkout@v4
1817
with:
1918
submodules: "recursive"
2019

docs/DEBUGGING.md

+44-2
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,17 @@
77
88
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).
99

10-
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.
10+
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.
1111

1212
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).
1313

14+
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).
15+
1416
## Using the Eclipse CDT GDB Debug Adapter
1517

16-
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
18+
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).
19+
20+
The basic arguments in launch.json are
1721

1822
```JSON
1923
{
@@ -38,6 +42,44 @@ The Eclipse CDT team have published a GDB debug adapter as NPM package which we
3842
}
3943
```
4044

45+
where `program` and `gdb` can be resolved by extension. Some additional arguments you might use are:
46+
47+
- `runOpenOCD`: (Default: true). Run extension openOCD Server.
48+
- `verifyAppBinBeforeDebug`: (Default: false) Verify that current ESP-IDF project binary is the same as binary in chip.
49+
- `logFile`: Absolute path to the file to log interaction with gdb.
50+
- `verbose`: Produce verbose log output.
51+
- `environment`: Environment variables to apply to the ESP-IDF Debug Adapter. It will replace global environment variables and environment variables used by the extension.
52+
53+
```json
54+
"environment": {
55+
"VAR": "Value"
56+
}
57+
```
58+
59+
- `imageAndSymbols`:
60+
61+
```json
62+
"imageAndSymbols": {
63+
"symbolFileName": "If specified, a symbol file to load at the given (optional) offset",
64+
"symbolOffset": "If symbolFileName is specified, the offset used to load",
65+
"imageFileName": "If specified, an image file to load at the given (optional) offset",
66+
"imageOffset": "If imageFileName is specified, the offset used to load"
67+
}
68+
```
69+
70+
- `target`: Configuration for target to be attached.
71+
72+
```json
73+
"target": {
74+
"type": "The kind of target debugging to do. This is passed to -target-select (defaults to remote)",
75+
"host": "Target host to connect to (defaults to 'localhost', ignored if parameters is set)",
76+
"port": "Target port to connect to (defaults to value captured by serverPortRegExp, ignored if parameters is set)",
77+
"parameters": "Target parameters for the type of target. Normally something like localhost:12345. (defaults to `${host}:${port}`)"
78+
}
79+
```
80+
81+
Other arguments please review this extension's package.json `gdbtarget` debugger contribution.
82+
4183
## Use Microsoft C/C++ Extension to Debug
4284

4385
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:

gulpfile.js

-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ const del = require("del");
1717
const vsce = require("vsce");
1818
const nls = require("vscode-nls-dev");
1919
const { readdirSync, statSync } = require("fs");
20-
const { readJSON, writeJSON } = require("fs-extra");
2120
const { join } = require("path");
2221
const glob = require("glob");
2322

@@ -34,7 +33,6 @@ languagesDirs.forEach((langDir) => {
3433
function clean(done) {
3534
del([
3635
"dist/**",
37-
"out/**",
3836
"package.nls.*.json",
3937
"*.vsix",
4038
"report.json",

package.json

+12-9
Original file line numberDiff line numberDiff line change
@@ -1481,8 +1481,7 @@
14811481
},
14821482
{
14831483
"type": "gdbtarget",
1484-
"label": "GDB Target",
1485-
"program": "./node_modules/cdt-gdb-adapter/dist/debugTargetAdapter.js",
1484+
"label": "Eclipse GDB Target",
14861485
"runtime": "node",
14871486
"configurationAttributes": {
14881487
"launch": {
@@ -1496,6 +1495,11 @@
14961495
"type": "string",
14971496
"description": "Working directory (cwd) to use when launching gdb. Defaults to the directory of the 'program'"
14981497
},
1498+
"runOpenOCD": {
1499+
"type": "boolean",
1500+
"description": "Run OpenOCD Server",
1501+
"default": true
1502+
},
14991503
"environment": {
15001504
"additionalProperties": {
15011505
"type": [
@@ -1934,14 +1938,12 @@
19341938
"type": "gdbtarget",
19351939
"request": "attach",
19361940
"name": "Eclipse CDT GDB Adapter",
1937-
"program": "${workspaceFolder}/build/${command:espIdf.getProjectName}.elf",
19381941
"initCommands": [
19391942
"set remote hardware-watchpoint-limit 2",
19401943
"mon reset halt",
19411944
"maintenance flush register-cache",
19421945
"thb app_main"
19431946
],
1944-
"gdb": "${command:espIdf.getXtensaGdb}",
19451947
"target": {
19461948
"port": "3333"
19471949
}
@@ -1955,14 +1957,12 @@
19551957
"type": "gdbtarget",
19561958
"request": "attach",
19571959
"name": "Eclipse CDT GDB Adapter",
1958-
"program": "^\"\\${workspaceFolder}/build/\\${command:espIdf.getProjectName}.elf\"",
19591960
"initCommands": [
19601961
"set remote hardware-watchpoint-limit 2",
19611962
"mon reset halt",
19621963
"maintenance flush register-cache",
19631964
"thb app_main"
19641965
],
1965-
"gdb": "^\"\\${command:espIdf.getXtensaGdb}\"",
19661966
"target": {
19671967
"port": "3333"
19681968
}
@@ -2052,14 +2052,15 @@
20522052
"@types/ws": "^7.2.5",
20532053
"@types/xml2js": "^0.4.11",
20542054
"@types/yauzl": "^2.9.1",
2055-
"@vscode/debugadapter": "^1.53.0",
2055+
"@vscode/debugadapter": "^1.65.0",
20562056
"@vscode/debugadapter-testsupport": "^1.51.0",
2057-
"@vscode/debugprotocol": "^1.53.0",
2057+
"@vscode/debugprotocol": "^1.65.0",
20582058
"@vscode/extension-telemetry": "0.4.8",
20592059
"@vscode/test-electron": "^2.1.2",
20602060
"@vue/compiler-sfc": "^3.3.4",
20612061
"bulma": "^0.9.3",
20622062
"chai": "^4.3.4",
2063+
"copy-webpack-plugin": "^12.0.2",
20632064
"css-loader": "^3.1.0",
20642065
"d3-scale": "^4.0.2",
20652066
"file-loader": "^6.2.0",
@@ -2079,6 +2080,7 @@
20792080
"reflect-metadata": "^0.1.13",
20802081
"sass": "^1.49.8",
20812082
"sass-loader": "^10",
2083+
"string-replace-loader": "^3.1.0",
20822084
"style-loader": "^3.3.1",
20832085
"ts-loader": "^9.4.4",
20842086
"typescript": "^5.2.2",
@@ -2098,7 +2100,6 @@
20982100
"assert": "^2.1.0",
20992101
"axios": "^1.6.0",
21002102
"bignumber.js": "^9.0.1",
2101-
"cdt-gdb-adapter": "^0.0.32",
21022103
"del": "^4.1.1",
21032104
"es6-promisify": "^6.0.0",
21042105
"follow-redirects": "^1.15.4",
@@ -2114,9 +2115,11 @@
21142115
"plotly.js-dist-min": "^2.26.1",
21152116
"postcss": "^8.4.31",
21162117
"sanitize-html": "^2.7.0",
2118+
"serialport": "^12.0.0",
21172119
"stream-browserify": "^3.0.0",
21182120
"tar-fs": "^2.0.0",
21192121
"tree-kill": "^1.2.2",
2122+
"utf8": "^3.0.0",
21202123
"vscode-languageclient": "^5.2.1",
21212124
"vscode-languageserver": "^5.2.1",
21222125
"vscode-nls": "^4.0.0",

0 commit comments

Comments
 (0)