From d8fb76bf8c15d928aab88db18676a671d177a6e4 Mon Sep 17 00:00:00 2001 From: James Swan <122404367+swan-amazon@users.noreply.github.com> Date: Tue, 7 May 2024 18:33:02 +0000 Subject: [PATCH] Add VSCode launch configuration for debugging chip-all-clusters-app This commit introduces a new VSCode launch configuration specifically tailored for debugging the `chip-all-clusters-app` program. The launch configuration is set up to utilize the LLDB Debugger with various customizations to enhance the debugging experience. Key features of the new launch configuration include: - Configuration named "LLDB Debugger: All Clusters App (chip-all-clusters-app)" - Type set to "lldb" for LLDB Debugger integration - Launch request configured to start debugging - Expression evaluation mode set to "native" - Source mapping defined to map source paths appropriately - Custom pre-run commands executed before launching the program - Program and arguments specified for debugging chip-all-clusters-app - Environment variables set to ensure correct execution environment - Standard I/O configured for integrated terminal usage - Debugging session set to stop on entry for easier inspection By adding this launch configuration, developers can seamlessly debug the chip-all-clusters-app program directly from within VSCode, improving productivity and easing the debugging process. --- .vscode/launch.json | 65 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/.vscode/launch.json b/.vscode/launch.json index 0ed822ad0251a9..afe60953d9f1bd 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -4,6 +4,71 @@ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ + { + "name": "LLDB Debugger: All Clusters App (chip-all-clusters-app)", + "type": "lldb", + "request": "launch", + "expressions": "native", + "sourceMap": { + "${workspaceFolder}/examples/all-clusters-app/": "${workspaceFolder}/examples/all-clusters-app/", + "${workspaceFolder}/examples/all-clusters-app/linux/third_party/connectedhomeip/": "${workspaceFolder}/" + }, + "relativePathBase": "${workspaceFolder}", + "breakpointMode": "path", + "sourceLanguages": ["cpp"], + "reverseDebugging": true, + "preRunCommands": ["platform shell rm /tmp/kvs.bin"], + "program": "${workspaceFolder}/out/linux-x64-all-clusters-no-ble-no-wifi/chip-all-clusters-app", + "args": ["--KVS=/tmp/kvs.bin", "--trace_decode=1"], + "cwd": "${workspaceFolder}/out/linux-x64-all-clusters-no-ble-no-wifi", + "env": { + "_PW_ACTUAL_ENVIRONMENT_ROOT": "${workspaceFolder}/.environment", + "_PW_ENVIRONMENT_CONFIG_FILE": "${workspaceFolder}/scripts/setup/environment.json", + "_PW_ROSETTA": "0", + "PW_ARM_CIPD_INSTALL_DIR": "${workspaceFolder}/.environment/cipd/packages/arm", + "PW_BRANDING_BANNER": "${workspaceFolder}/scripts/setup/banner.txt", + "PW_PACKAGE_ROOT": "${workspaceFolder}/.environment/packages", + "PW_PIGWEED_CIPD_INSTALL_DIR": "${workspaceFolder}/.environment/cipd/packages/pigweed", + "PW_PROJECT_ROOT": "${workspaceFolder}", + "PW_PYTHON_CIPD_INSTALL_DIR": "${workspaceFolder}/.environment/cipd/packages/python", + "PW_ROOT": "${workspaceFolder}/third_party/pigweed/repo", + "PW_ZAP_CIPD_INSTALL_DIR": "${workspaceFolder}/.environment/cipd/packages/zap", + "PATH": "${workspaceFolder}/third_party/pigweed/repo/out/host/host_tools:${workspaceFolder}/.environment/pigweed-venv/bin:${workspaceFolder}/.environment/cipd/packages/arm/bin:${workspaceFolder}/.environment/cipd/packages/arm:${workspaceFolder}/.environment/cipd/packages/zap:${workspaceFolder}/.environment/cipd/packages/pigweed/bin:${workspaceFolder}/.environment/cipd/packages/pigweed:${workspaceFolder}/.environment/cip:${containerEnv:PATH}" + }, + "stdio": [null, null, null], + "terminal": "integrated", + "stopOnEntry": true + }, + { + "name": "LLDB Debugger: Chip-Tool (chip-tool)", + "type": "lldb", // [vadimcn/codelldb](https://github.com/vadimcn/codelldb) + "request": "launch", + "expressions": "native", + "sourceMap": { + "${workspaceFolder}/examples/chip-tool/": "${workspaceFolder}/examples/chip-tool/", + "${workspaceFolder}/examples/chip-tool/third_party/connectedhomeip/": "${workspaceFolder}/" + }, + "relativePathBase": "${workspaceFolder}", + "breakpointMode": "path", + "sourceLanguages": ["cpp"], + "reverseDebugging": true, + "program": "${workspaceFolder}/out/linux-x64-chip-tool/chip-tool", + "args": [ + "pairing", + "code", + "1", + "34970112332", + "--trace_decode", + "1", + "--country-code", + "US" + ], + "cwd": "${workspaceFolder}/out/linux-x64-chip-tool", + "env": {}, + "stdio": [null, null, null], + "terminal": "console", + "stopOnEntry": false + }, { "name": "Attach to running process", "type": "lldb",