From 4830c7c9c1b7355fedcfb8785e316f0711921ade Mon Sep 17 00:00:00 2001 From: James Goppert Date: Sat, 19 Sep 2015 10:39:54 -0400 Subject: [PATCH] Added io debug target. --- Makefile | 2 +- cmake/toolchains/Toolchain-arm-none-eabi.cmake | 2 +- src/firmware/nuttx/CMakeLists.txt | 9 ++++++++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index db133aea51..5041ff4c51 100644 --- a/Makefile +++ b/Makefile @@ -110,7 +110,7 @@ clean: rm -rf build_*/ # targets handled by cmake -cmake_targets = test upload package package_source debug check_weak +cmake_targets = test upload package package_source debug debug_io check_weak $(foreach targ,$(cmake_targets),$(eval $(call cmake-targ,$(targ)))) .PHONY: clean diff --git a/cmake/toolchains/Toolchain-arm-none-eabi.cmake b/cmake/toolchains/Toolchain-arm-none-eabi.cmake index 80da3ad1a2..d067620f12 100644 --- a/cmake/toolchains/Toolchain-arm-none-eabi.cmake +++ b/cmake/toolchains/Toolchain-arm-none-eabi.cmake @@ -37,7 +37,7 @@ endif() cmake_force_cxx_compiler(${CXX_COMPILER} GNU) # compiler tools -foreach(tool objcopy nm ld gdb) +foreach(tool objcopy nm ld gdb gdbtui) string(TOUPPER ${tool} TOOL) find_program(${TOOL} arm-none-eabi-${tool}) if(NOT ${TOOL}) diff --git a/src/firmware/nuttx/CMakeLists.txt b/src/firmware/nuttx/CMakeLists.txt index bb9aac3113..36132e6f38 100644 --- a/src/firmware/nuttx/CMakeLists.txt +++ b/src/firmware/nuttx/CMakeLists.txt @@ -56,7 +56,14 @@ if(NOT ${BOARD} STREQUAL "sim") configure_file(gdbinit.in .gdbinit) add_custom_target(debug - COMMAND ${GDB} ${CMAKE_CURRENT_BINARY_DIR}/firmware_nuttx + COMMAND ${GDBTUI} ${CMAKE_CURRENT_BINARY_DIR}/firmware_nuttx + DEPENDS firmware_nuttx + ${CMAKE_CURRENT_BINARY_DIR}/.gdbinit + ) + + add_custom_target(debug_io + COMMAND ${GDBTUI} + ${CMAKE_BINARY_DIR}/src/modules/px4iofirmware/${config_io_board}_${LABEL} DEPENDS firmware_nuttx ${CMAKE_CURRENT_BINARY_DIR}/.gdbinit )