From 55f963be07dbb8acd147c290a0fcba0b4877336d Mon Sep 17 00:00:00 2001 From: James Goppert Date: Tue, 6 Oct 2015 12:10:23 -0400 Subject: [PATCH] Added ddd support. --- Makefile | 2 +- .../toolchains/Toolchain-arm-none-eabi.cmake | 14 +++++++++- src/firmware/nuttx/CMakeLists.txt | 26 +++++++++++++++++++ 3 files changed, 40 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 883e0663da..1d2cd152ff 100644 --- a/Makefile +++ b/Makefile @@ -153,7 +153,7 @@ distclean: clean @cd ../../.. # targets handled by cmake -cmake_targets = test upload package package_source debug debug_io check_weak libuavcan +cmake_targets = test upload package package_source debug debug_tui debug_ddd debug_io debug_io_tui debug_io_ddd check_weak libuavcan $(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 45da0d965c..ac13b9f517 100644 --- a/cmake/toolchains/Toolchain-arm-none-eabi.cmake +++ b/cmake/toolchains/Toolchain-arm-none-eabi.cmake @@ -49,6 +49,9 @@ endforeach() foreach(tool gdb gdbtui) string(TOUPPER ${tool} TOOL) find_program(${TOOL} arm-none-eabi-${tool}) + if(NOT ${TOOL}) + message(STATUS "could not find ${tool}") + endif() endforeach() # os tools @@ -56,7 +59,16 @@ foreach(tool echo patch grep rm mkdir nm genromfs cp touch make unzip) string(TOUPPER ${tool} TOOL) find_program(${TOOL} ${tool}) if(NOT ${TOOL}) - message(FATAL_ERROR "could not find ${TOOL}") + message(FATAL_ERROR "could not find ${tool}") + endif() +endforeach() + +# optional os tools +foreach(tool ddd) + string(TOUPPER ${tool} TOOL) + find_program(${TOOL} ${tool}) + if(NOT ${TOOL}) + message(STATUS "could not find ${tool}") endif() endforeach() diff --git a/src/firmware/nuttx/CMakeLists.txt b/src/firmware/nuttx/CMakeLists.txt index 2b1562b762..8767f3fde5 100644 --- a/src/firmware/nuttx/CMakeLists.txt +++ b/src/firmware/nuttx/CMakeLists.txt @@ -63,18 +63,44 @@ if(NOT ${BOARD} STREQUAL "sim") configure_file(gdbinit.in .gdbinit) add_custom_target(debug + COMMAND ${GDB} ${CMAKE_CURRENT_BINARY_DIR}/firmware_nuttx + DEPENDS firmware_nuttx + ${CMAKE_CURRENT_BINARY_DIR}/.gdbinit + ) + + add_custom_target(debug_tui COMMAND ${GDBTUI} ${CMAKE_CURRENT_BINARY_DIR}/firmware_nuttx DEPENDS firmware_nuttx ${CMAKE_CURRENT_BINARY_DIR}/.gdbinit ) + add_custom_target(debug_ddd + COMMAND ${DDD} --debugger ${GDB} ${CMAKE_CURRENT_BINARY_DIR}/firmware_nuttx + DEPENDS firmware_nuttx + ${CMAKE_CURRENT_BINARY_DIR}/.gdbinit + ) + add_custom_target(debug_io + COMMAND ${GDB} + ${CMAKE_BINARY_DIR}/src/modules/px4iofirmware/${config_io_board}_${LABEL} + DEPENDS firmware_nuttx + ${CMAKE_CURRENT_BINARY_DIR}/.gdbinit + ) + + add_custom_target(debug_io_tui COMMAND ${GDBTUI} ${CMAKE_BINARY_DIR}/src/modules/px4iofirmware/${config_io_board}_${LABEL} DEPENDS firmware_nuttx ${CMAKE_CURRENT_BINARY_DIR}/.gdbinit ) + add_custom_target(debug_io_ddd + COMMAND ${DDD} --debugger ${GDB} + ${CMAKE_BINARY_DIR}/src/modules/px4iofirmware/${config_io_board}_${LABEL} + DEPENDS firmware_nuttx + ${CMAKE_CURRENT_BINARY_DIR}/.gdbinit + ) + px4_add_upload(OUT upload OS ${OS} BOARD ${BOARD} BUNDLE ${fw_file}) endif()