Skip to content

Commit 84080fa

Browse files
committed
Arm-FVP: Add singlecore-launch in launch.json
1 parent c5de2d5 commit 84080fa

2 files changed

Lines changed: 58 additions & 3 deletions

File tree

registry/debug-adapters.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -659,6 +659,9 @@ debug-adapters:
659659
template: FVP.adapter.json # template files
660660
defaults:
661661
model: "FVP_MPS2_Cortex-M3"
662+
gdbserver:
663+
active:
664+
port: 10000
662665
user-interface:
663666
- section: Model
664667
description: Arm FVP simulation model setup

templates/FVP.adapter.json

Lines changed: 55 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"data": {
3+
"cwd": "${workspaceFolder}/<%= solution_folder %>",
34
"shell": {
45
"win32": {
56
"executable": "cmd.exe",
@@ -13,14 +14,65 @@
1314
"executable": "/bin/bash",
1415
"args": [ "-c" ]
1516
}
17+
},
18+
"program": "<%= symbol_files[0]?.file ?? '' %>",
19+
"programs": "<%= symbol_files.flatMap(e => (e.pname || !processors?.length) ? e : processors.map(p => ({ ...e, pname: p }))).groupedBy(v => v.pname ?? '') %>",
20+
"gdbServerPlugin": "${env:AVH_FVP_PLUGINS}<%= platform === 'win32' ? 'GDBServer.dll' : 'GDBServer.so' %>"
21+
},
22+
"launch": {
23+
"singlecore-launch": {
24+
"name": "Arm-FVP@pyOCD (launch)",
25+
"type": "gdbtarget",
26+
"request": "launch",
27+
"cwd": "<%= data.cwd %>",
28+
"program": "<%= data.program %>",
29+
"gdb": "arm-none-eabi-gdb",
30+
"auxiliaryGdb": false,
31+
"initCommands": [
32+
"<%= data.programs[pname]?.slice(1)?.map(p => p.file ? `add-symbol-file \"${p.file}\"\\n` : '')?.join('') %>",
33+
"monitor reset halt",
34+
"tbreak main"
35+
],
36+
"customResetCommands": [
37+
"monitor reset halt",
38+
"maintenance flush register-cache",
39+
"maintenance flush dcache",
40+
"tbreak main",
41+
"continue"
42+
],
43+
"target": {
44+
"server": "<%= config.model %>",
45+
"serverParameters": [
46+
"-D",
47+
"--plugin", "<%= data.gdbServerPlugin %>\n",
48+
"<% if (config['config-file']) { %>",
49+
"-f", "<%= config['config-file'] %>\n",
50+
"<% } %>",
51+
"<% if (Array.isArray(config.args) && config.args.length > 0) { %>",
52+
"<%= config.args.join('\\n') %>\n",
53+
"<% } %>",
54+
"<% else if (typeof config.args === 'string' && config.args.trim().length > 0) { %>",
55+
"<%= config.args.trim().split(/\\s+/).join('\\n') %>\n",
56+
"<% } %>",
57+
"<% const files = image_files.length ? image_files.map(s => s.file) : [data.program].filter(Boolean) %>",
58+
"<% for (const [idx, file] of files.entries()) { %>",
59+
"-a", "<%= file %><%= idx + 1 < files.length ? '\\n' : '' %>",
60+
"<% } %>"
61+
],
62+
"port": "\"<%= ports.get(pname) %>\""
63+
},
64+
"cmsis": {
65+
"cbuildRunFile": "${command:cmsis-csolution.getCbuildRunFile}",
66+
"updateConfiguration": "auto"
67+
}
1668
}
1769
},
1870
"tasks": [{
1971
"label": "CMSIS Load+Run",
2072
"type": "shell",
2173
"command": "<%= config.model %>",
2274
"options": {
23-
"cwd": "${workspaceFolder}/<%= solution_folder %>",
75+
"cwd": "<%= data.cwd %>",
2476
"shell": "<%= data.shell[process.platform] %>"
2577
},
2678
"args": [
@@ -34,8 +86,8 @@
3486
"<%= config.args.trim().split(/\\s+/).join('\\n') %>\n",
3587
"<% } %>",
3688
"<% const files = image_files.map(s => s.file) %>",
37-
"<% for (const file of files) { %>",
38-
"-a", "<%= file %>\n",
89+
"<% for (const [idx, file] of files.entries()) { %>",
90+
"-a", "<%= file %><%= idx + 1 < files.length ? '\\n' : '' %>",
3991
"<% } %>"
4092
],
4193
"problemMatcher": []

0 commit comments

Comments
 (0)