Improve gdb runner

This commit is contained in:
Berkus Decker 2020-11-04 22:22:43 +02:00
parent 1776dac439
commit 6da44a69ac
2 changed files with 11 additions and 6 deletions

View File

@ -61,6 +61,8 @@ QEMU_TESTS_OPTS = "-nographic"
# - port 5555 used to match JLink configuration, so we can reuse the same GDB command for both QEMU and JTAG.
QEMU_GDB_OPTS = "-gdb tcp::5555 -S"
GDB_CONNECT_FILE = "${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/target/${TARGET}/gdb-connect"
KERNEL_ELF = "${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/kernel8"
KERNEL_BIN = "${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/kernel8.img"

View File

@ -63,18 +63,21 @@ script = [
"${OPENOCD} -f interface/jlink.cfg -f ../doc/rpi2rpi_jtag/rpi3_target.cfg"
]
[tasks.gdb]
dependencies = ["build", "kernel-binary"]
env = { "RUST_GDB" = "${GDB}" }
[tasks.gdb-config]
script_runner = "@duckscript"
script = [
'''
connectFile = set ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/target/${TARGET}/gdb-connect
writefile ${connectFile} "target remote :5555\n"
exec --fail-on-error rust-gdb -x ${connectFile} ${KERNEL_ELF}
writefile ${GDB_CONNECT_FILE} "target remote :5555\n"
'''
]
[tasks.gdb]
dependencies = ["build", "kernel-binary", "gdb-config"]
env = { "RUST_GDB" = "${GDB}" }
script = [
"rust-gdb -x ${GDB_CONNECT_FILE} ${KERNEL_ELF}"
]
[tasks.sdcard]
dependencies = ["build", "kernel-binary"]
script_runner = "@duckscript"