ide-plugins/packages/dsp-mod-debug/package.json

465 lines
16 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
"name": "dsp-mod-debug",
"displayName": "DSP Debug Module",
"description": "Debug module with dual-track cppdbg and gdb-dap, plus DSS DAP support.",
"publisher": "yhftide",
"version": "0.1.0",
"engines": {
"vscode": "^1.70.0"
},
"main": "./dist/extension.js",
"activationEvents": [
"onCommand:dspide.debugStartWithSavedConfig",
"onCommand:dspide.debug.capabilityCheck",
"onCommand:dspide.debug.startCurrentFile",
"onCommand:dspide.debug.continueAll",
"onCommand:dspide.debug.continueThread",
"onCommand:dspide.debug.haltAll",
"onCommand:dspide.debug.switchCore",
"onCommand:dspide.debug.threadStatus",
"onCommand:dspide.debug.dss.checkEnvironment",
"onCommand:dspide.debug.dss.selectCcxml",
"onDebugResolve:dss-dap",
"onDebugResolve:gdb-dap"
],
"contributes": {
"commands": [
{
"command": "dspide.debugStartWithSavedConfig",
"title": "DSP: 启动调试(兼容入口)"
},
{
"command": "dspide.debug.capabilityCheck",
"title": "DSP: 检查调试能力与工具路径"
},
{
"command": "dspide.debug.startCurrentFile",
"title": "DSP: 启动当前文件调试"
},
{
"command": "dspide.debug.continueAll",
"title": "全核继续",
"icon": "$(debug-continue)"
},
{
"command": "dspide.debug.continueThread",
"title": "DSP: 当前核继续 (Continue Thread)"
},
{
"command": "dspide.debug.switchCore",
"title": "DSP: 切换调试核"
},
{
"command": "dspide.debug.threadStatus",
"title": "DSP: 查看线程状态"
},
{
"command": "dspide.debug.dss.checkEnvironment",
"title": "DSP: 检查 DSS 调试环境"
},
{
"command": "dspide.debug.dss.selectCcxml",
"title": "DSP: 选择 CCXML 配置文件"
},
{
"command": "dspide.debug.haltAll",
"title": "全核暂停",
"icon": "$(debug-pause)"
}
],
"submenus": [
{
"id": "dspide.debug.multiCoreMenu",
"label": "多核操作",
"icon": "$(server)"
}
],
"menus": {
"debug/toolBar": [
{
"submenu": "dspide.debug.multiCoreMenu",
"when": "debugType == dss-dap",
"group": "navigation@1"
}
],
"dspide.debug.multiCoreMenu": [
{
"command": "dspide.debug.continueAll",
"group": "1_continue@1"
},
{
"command": "dspide.debug.haltAll",
"group": "2_halt@1"
}
]
},
"configuration": {
"title": "DSP Debug",
"properties": {
"dsp.debug.enableDualTrack": {
"type": "boolean",
"default": true,
"description": "启用双轨调试cppdbg + gdb-dap兼容。"
},
"dsp.debug.defaultType": {
"type": "string",
"enum": [
"gdb-dap",
"cppdbg",
"dss-dap"
],
"default": "gdb-dap",
"description": "默认调试类型。"
},
"dsp.debug.dss.ccsPath": {
"type": "string",
"default": "",
"description": "TI CCS 安装路径。例如: C:\\ti\\ccsv7。为空时自动检测。"
},
"dsp.debug.dss.dssBatPath": {
"type": "string",
"default": "",
"description": "dss.bat 完整路径。为空时使用 CCS 默认路径。"
},
"dsp.debug.dss.dis6xPath": {
"type": "string",
"default": "",
"description": "dis6x.exe 路径。为空时根据 CCS 路径自动推断。"
},
"dsp.debug.dss.ofd6xPath": {
"type": "string",
"default": "",
"description": "ofd6x.exe 路径。为空时根据 CCS 路径自动推断。"
},
"dsp.debug.dss.defaultCcxml": {
"type": "string",
"default": "",
"description": "默认 CCXML 配置文件路径。"
},
"dsp.debug.dss.timeout": {
"type": "number",
"default": 120000,
"description": "DSS 命令超时时间(毫秒)。"
},
"dsp.debug.dss.enableSourceMap": {
"type": "boolean",
"default": true,
"description": "启用反汇编源码映射。"
},
"dsp.debug.dss.sourceMap": {
"type": "array",
"default": [],
"description": "源码路径映射规则。将编译时路径映射到本地路径。",
"items": {
"type": "object",
"properties": {
"compilePath": {
"type": "string",
"description": "编译时的源码路径前缀"
},
"localPath": {
"type": "string",
"description": "本地实际路径"
},
"enabled": {
"type": "boolean",
"default": true,
"description": "是否启用此规则"
}
}
}
},
"dsp.debug.dss.builtinLibrarySources": {
"type": "string",
"default": "",
"description": "内置库源码路径(由 dsp-core 提供,通常无需手动配置)。"
}
}
},
"debuggers": [
{
"type": "gdb-dap",
"label": "GDB DAP (Wrapped)",
"runtime": "node",
"configurationAttributes": {
"launch": {
"required": ["program"],
"properties": {
"program": {
"type": "string",
"description": "Program to debug (.out/.elf)"
},
"cwd": {
"type": "string",
"description": "Working directory"
},
"args": {
"type": "array",
"description": "Program arguments",
"items": {
"type": "string"
}
},
"gdbPath": {
"type": "string",
"description": "Path to gdb binary"
},
"dapServerMode": {
"type": "string",
"enum": ["gdb", "external"],
"default": "gdb",
"description": "gdb: gdb binary itself serves DAP; external: launch separate dapserver --gdb"
},
"dspLaunchMode": {
"type": "string",
"enum": ["manualLoad", "gdbNative"],
"default": "manualLoad",
"description": "manualLoad: DSP/JTAG synchronized all-stop launch, wrapper runs opencore -> file -> load; gdbNative: use native GDB DAP launch behavior."
},
"dapServerPath": {
"type": "string",
"description": "Path to DAP server executable (used in external mode, optional in gdb mode)"
},
"dapServerCwd": {
"type": "string",
"description": "Working directory for gdb/dapserver process. Defaults to launch cwd/program folder/workspace."
},
"gdbDataDirectory": {
"type": "string",
"description": "Optional gdb data directory. If unset, wrapper auto-detects near gdb executable."
},
"traceDapTraffic": {
"type": "boolean",
"default": true,
"description": "Print VSCode<->DAP<->GDB traffic logs to debug output channel."
},
"traceDapPayloadMaxLen": {
"type": "number",
"default": 1200,
"description": "Max characters for each traced DAP payload line."
},
"pauseAllThreadsBeforeConfigurationDone": {
"type": "boolean",
"default": true,
"description": "Send per-thread pause requests before configurationDone after opencore injection."
},
"allowNotStoppedOnConfigurationDone": {
"type": "boolean",
"default": true,
"description": "Tolerate gdb notStopped response for configurationDone to avoid immediate session teardown."
},
"opencoreInjectPhase": {
"type": "string",
"enum": ["beforeLaunch", "beforeConfigurationDone", "afterConfigurationDone"],
"default": "beforeConfigurationDone",
"description": "When to inject opencore evaluate in DAP lifecycle."
},
"opencoreInjectDelayMs": {
"type": "number",
"default": 0,
"description": "Optional delay before opencore evaluate injection."
},
"injectOpenCore": {
"type": "boolean",
"default": true,
"description": "Inject opencore command after configurationDone"
},
"opencoreCommand": {
"type": "string",
"default": "opencore",
"description": "Command to inject by DAP evaluate"
},
"opencoreArgs": {
"type": "string",
"default": "0 1 2 3",
"description": "Arguments appended to opencore command"
}
}
}
},
"initialConfigurations": [
{
"name": "DSP GDB DAP Launch",
"type": "gdb-dap",
"request": "launch",
"program": "${workspaceFolder}/Debug/program.out",
"cwd": "${workspaceFolder}",
"dapServerMode": "gdb",
"dspLaunchMode": "manualLoad",
"traceDapTraffic": true,
"traceDapPayloadMaxLen": 1200,
"pauseAllThreadsBeforeConfigurationDone": true,
"allowNotStoppedOnConfigurationDone": true,
"injectOpenCore": true,
"opencoreArgs": "0 1 2 3"
}
],
"configurationSnippets": [
{
"label": "GDB DAP: Launch (Wrapped)",
"description": "Launch gdb-dap with transparent proxy and opencore injection",
"body": {
"name": "DSP GDB DAP Launch",
"type": "gdb-dap",
"request": "launch",
"program": "^\"\\${workspaceFolder}/Debug/program.out\"",
"cwd": "^\"\\${workspaceFolder}\"",
"dapServerMode": "gdb",
"dspLaunchMode": "manualLoad",
"traceDapTraffic": true,
"traceDapPayloadMaxLen": 1200,
"pauseAllThreadsBeforeConfigurationDone": true,
"allowNotStoppedOnConfigurationDone": true,
"injectOpenCore": true,
"opencoreArgs": "0 1 2 3"
}
}
]
},
{
"type": "dss-dap",
"label": "DSS DAP Debug",
"runtime": "node",
"configurationAttributes": {
"launch": {
"properties": {
"program": {
"type": "string",
"description": "要调试的程序文件路径(.out/.elf)。单核或默认核调试时使用;与 programs 至少提供一项。"
},
"ccxml": {
"type": "string",
"description": "CCXML 目标配置文件路径"
},
"sessionName": {
"type": "string",
"description": "调试会话名称,格式: 仿真器名称/处理器名称",
"default": "Blackhawk XDS560v2-USB Mezzanine Emulator_0/C66xx_0"
},
"stopOnEntry": {
"type": "boolean",
"description": "是否在入口点停止",
"default": false
},
"timeout": {
"type": "number",
"description": "DSS 命令超时时间(毫秒)",
"default": 120000
},
"disasm": {
"type": "object",
"description": "反汇编配置",
"properties": {
"dis6xPath": {
"type": "string",
"description": "dis6x.exe 路径"
},
"ofd6xPath": {
"type": "string",
"description": "ofd6x.exe 路径"
},
"enableSourceMap": {
"type": "boolean",
"description": "启用源码映射",
"default": true
}
}
},
"sourceMap": {
"type": "array",
"description": "源码路径映射规则。将编译时路径映射到本地路径。",
"items": {
"type": "object",
"properties": {
"compilePath": {
"type": "string",
"description": "编译时的源码路径前缀"
},
"localPath": {
"type": "string",
"description": "本地实际路径"
},
"suffixMatch": {
"type": "boolean",
"default": false,
"description": "启用后缀匹配模式,匹配路径末尾部分(如 lib-internal/src忽略前面的编译环境路径"
},
"enabled": {
"type": "boolean",
"default": true,
"description": "是否启用此规则"
}
}
}
},
"programs": {
"type": "array",
"description": "多核程序配置为不同CPU指定程序路径异构多核调试与 program 至少提供一项。",
"items": {
"type": "object",
"required": ["cpuIndex", "program"],
"properties": {
"cpuIndex": {
"type": "number",
"description": "CPU索引0-based对应ccxml配置中的CPU顺序"
},
"program": {
"type": "string",
"description": "该CPU要加载的程序路径"
}
}
}
}
}
}
},
"initialConfigurations": [
{
"name": "DSS DAP Launch",
"type": "dss-dap",
"request": "launch",
"program": "${workspaceFolder}/Debug/program.out",
"ccxml": "${workspaceFolder}/target.ccxml",
"stopOnEntry": false
}
],
"configurationSnippets": [
{
"label": "DSS DAP: Launch",
"description": "启动 DSS DAP 调试会话",
"body": {
"name": "DSS DAP Launch",
"type": "dss-dap",
"request": "launch",
"program": "^\"\\${workspaceFolder}/Debug/program.out\"",
"ccxml": "^\"\\${workspaceFolder}/target.ccxml\"",
"stopOnEntry": false
}
}
]
}
]
},
"scripts": {
"clean": "if exist dist rmdir /s /q dist",
"build": "tsc -p ./tsconfig.json",
"watch": "tsc -w -p ./tsconfig.json",
"package": "vsce package --no-dependencies --allow-missing-repository",
"package:dss-exe": "pkg dist/dssAdapter/index.js --targets node18-win-x64 --output dist/dss-adapter.exe"
},
"dependencies": {
"@vscode/debugadapter": "^1.68.0",
"@vscode/debugprotocol": "^1.68.0",
"iconv-lite": "^0.7.2"
},
"devDependencies": {
"@types/node": "^18.0.0",
"@types/vscode": "^1.70.0",
"typescript": "^5.0.0"
},
"files": [
"dist/**/*",
"dss_script/**/*"
]
}