Improve gdb runner
This commit is contained in:
parent
1776dac439
commit
6da44a69ac
|
@ -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"
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue