mirror of
https://github.com/panpaul/tiny_os
synced 2024-09-20 09:45:19 +08:00
chore: update vscode debug script
This commit is contained in:
parent
71faad766d
commit
a2dce7ad48
22
.vscode/launch.json
vendored
22
.vscode/launch.json
vendored
@ -2,7 +2,7 @@
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Debug",
|
||||
"name": "Debug Test",
|
||||
"preLaunchTask": "build test",
|
||||
"type": "cppdbg",
|
||||
"request": "launch",
|
||||
@ -21,5 +21,25 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Debug Kernel",
|
||||
"preLaunchTask": "build kernel",
|
||||
"type": "cppdbg",
|
||||
"request": "launch",
|
||||
"program": "${workspaceFolder}/target/kernel_exe",
|
||||
"cwd": "${workspaceFolder}",
|
||||
"MIMode": "gdb",
|
||||
"miDebuggerPath": "/usr/bin/gdb-multiarch",
|
||||
"miDebuggerServerAddress": "localhost:1234",
|
||||
"setupCommands": [
|
||||
{
|
||||
"text": "-enable-pretty-printing",
|
||||
"ignoreFailures": true
|
||||
},
|
||||
{
|
||||
"text": "set output-radix 16"
|
||||
}
|
||||
]
|
||||
},
|
||||
]
|
||||
}
|
3
.vscode/prepare_kernel.sh
vendored
Executable file
3
.vscode/prepare_kernel.sh
vendored
Executable file
@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
TARGET=$(make build-target 2>/dev/null)
|
||||
cp "./target/$TARGET/debug/kernel" target/kernel_exe
|
2
.vscode/prepare_test.sh
vendored
2
.vscode/prepare_test.sh
vendored
@ -1,2 +1,2 @@
|
||||
#!/bin/bash
|
||||
cargo xtask test --arch=riscv64 --dump 2>/dev/null | jq -r '[inputs] | map(select(has("executable")) | .executable) | last' | xargs -I{} cp {} target/test_exe
|
||||
make kernel-test-dump 2>/dev/null | jq -r '[inputs] | map(select(has("executable")) | .executable) | last' | xargs -I{} cp {} target/test_exe
|
||||
|
6
.vscode/tasks.json
vendored
6
.vscode/tasks.json
vendored
@ -6,6 +6,12 @@
|
||||
"label": "build test",
|
||||
"command": "./.vscode/prepare_test.sh",
|
||||
"problemMatcher": []
|
||||
},
|
||||
{
|
||||
"type": "shell",
|
||||
"label": "build kernel",
|
||||
"command": "./.vscode/prepare_kernel.sh",
|
||||
"problemMatcher": []
|
||||
}
|
||||
]
|
||||
}
|
8
Makefile
8
Makefile
@ -32,6 +32,12 @@ test:
|
||||
cargo test -p utils
|
||||
env RUSTFLAGS="$(RUSTFLAGS)" cargo test $(CARGO_TARGET_ARGS) --bin=kernel
|
||||
|
||||
kernel-test-dump:
|
||||
@env RUSTFLAGS="$(RUSTFLAGS)" cargo test $(CARGO_TARGET_ARGS) --bin=kernel --no-run --message-format=json
|
||||
|
||||
build-target:
|
||||
@echo $(BUILD_TARGET)
|
||||
|
||||
clean:
|
||||
cargo clean
|
||||
|
||||
@ -64,4 +70,4 @@ qemu-replay: kernel replay.qcow2
|
||||
-drive file=replay.qcow2,if=none,id=rr \
|
||||
-s -S
|
||||
|
||||
.PHONY: kernel clippy test clean qemu qemu-gdb qemu-record qemu-replay
|
||||
.PHONY: kernel clippy test kernel-test-dump build-target clean qemu qemu-gdb qemu-record qemu-replay
|
||||
|
Loading…
Reference in New Issue
Block a user