forked from WebFreak001/code-debug
-
Notifications
You must be signed in to change notification settings - Fork 12
/
xv6_launch.json
149 lines (148 loc) · 6.5 KB
/
xv6_launch.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
{
"version": "0.2.0",
"configurations": [
{
"type": "gdb",
"request": "attach",
"name": "Attach to Qemu",
"autorun": ["add-symbol-file ${workspaceFolder}/kernel/kernel"],
"target": ":1234",
"remote": true,
"cwd": "${workspaceFolder}",
"valuesFormatting": "parseText",
"gdbpath": "riscv64-unknown-elf-gdb",
"showDevDebugOutput":true,
"internalConsoleOptions": "openOnSessionStart",
"printCalls": true,
"stopAtConnect": true,
//"debugServer": 4711,//tiaoshi
"qemuPath": "qemu-system-riscv64",
"qemuArgs": [
"-machine", "virt", "-bios", "none",
"-kernel", "${workspaceFolder}/kernel/kernel",
"-m", "128M", "-smp", "2", "-nographic",
"-global", "virtio-mmio.force-legacy=false",
"-drive", "file=${workspaceFolder}/fs.img,if=none,format=raw,id=x0",
"-device", "virtio-blk-device,drive=x0,bus=virtio-mmio-bus.0",
"-s", "-S"
],
"program_counter_id": 32,
"first_breakpoint_group": "kernel",
"second_breakpoint_group":"${workspaceFolder}/user/init.c",
"kernel_memory_ranges":[["0x80000000","0xffffffffffffffff"]],
"user_memory_ranges":[["0x0000000000000000","0x80000000"]],
"border_breakpoints":[
{
"filepath": "${workspaceFolder}/user/usys.S",
"line":6
},
{
"filepath": "${workspaceFolder}/user/usys.S",
"line":11
},
{
"filepath": "${workspaceFolder}/user/usys.S",
"line":16
},
{
"filepath": "${workspaceFolder}/user/usys.S",
"line":21
},
{
"filepath": "${workspaceFolder}/user/usys.S",
"line":26
},
{
"filepath": "${workspaceFolder}/user/usys.S",
"line":31
},
{
"filepath": "${workspaceFolder}/user/usys.S",
"line":36
},
{
"filepath": "${workspaceFolder}/user/usys.S",
"line":41
},
{
"filepath": "${workspaceFolder}/user/usys.S",
"line":46
},
{
"filepath": "${workspaceFolder}/user/usys.S",
"line":51
},
{
"filepath": "${workspaceFolder}/user/usys.S",
"line":56
},
{
"filepath": "${workspaceFolder}/user/usys.S",
"line":61
},
{
"filepath": "${workspaceFolder}/user/usys.S",
"line":66
},
{
"filepath": "${workspaceFolder}/user/usys.S",
"line":71
},{
"filepath": "${workspaceFolder}/user/usys.S",
"line":76
},
{
"filepath": "${workspaceFolder}/user/usys.S",
"line":81
},
{
"filepath": "${workspaceFolder}/user/usys.S",
"line":86
},
{
"filepath": "${workspaceFolder}/user/usys.S",
"line":91
},
{
"filepath": "${workspaceFolder}/user/usys.S",
"line":96
},
{
"filepath": "${workspaceFolder}/user/usys.S",
"line":101
},
{
"filepath": "${workspaceFolder}/user/usys.S",
"line":106
},
{
"filepath": "${workspaceFolder}/kernel/trap.c",
"line":129
}
],
"hook_breakpoints":[
{
"breakpoint": {
"file": "${workspaceFolder}/kernel/sysfile.c",
"line": 464
},
"behavior": {
"isAsync": true,
"functionArguments": "",
"functionBody": "let p=await this.getStringVariable('path'); return '${workspaceFolder}/user/'+p+'.c' "
}
}
],
"filePathToBreakpointGroupNames": {
"isAsync": false,
"functionArguments": "filePathStr",
"functionBody": "if (filePathStr.includes('kernel')) { return ['kernel']; } else if (filePathStr === '${workspaceFolder}/user/usys.S') { return ['${workspaceFolder}/user/ln.c', '${workspaceFolder}/user/ls.c', '${workspaceFolder}/user/rm.c', '${workspaceFolder}/user/sh.c', '${workspaceFolder}/user/wc.c', '${workspaceFolder}/user/cat.c', '${workspaceFolder}/user/echo.c', '${workspaceFolder}/user/grep.c', '${workspaceFolder}/user/init.c', '${workspaceFolder}/user/kill.c', '${workspaceFolder}/user/ulib.c', '${workspaceFolder}/user/grind.c', '${workspaceFolder}/user/mkdir.c', '${workspaceFolder}/user/printf.c', '${workspaceFolder}/user/zombie.c', '${workspaceFolder}/user/umalloc.c', '${workspaceFolder}/user/forktest.c', '${workspaceFolder}/user/stressfs.c', '${workspaceFolder}/user/usertests.c']; } else if (filePathStr.includes('user') && filePathStr !== '${workspaceFolder}/user/usys.S') { return [filePathStr]; } else { return ['kernel']; }"
},
"breakpointGroupNameToDebugFilePaths":{
"isAsync": false,
"functionArguments": "groupName",
"functionBody": "if (groupName === 'kernel') { return ['${workspaceFolder}/kernel/kernel']; } else { let pathSplited = groupName.split('/'); let filename = pathSplited[pathSplited.length - 1].split('.'); let filenameWithoutExtension = filename[filename.length - 2]; return ['${workspaceFolder}/user/' + '_' + filenameWithoutExtension]; }"
}
}
]
}