mirror of https://github.com/ARMmbed/mbed-os.git
Fix gdbinit and make debug-xxx not working when executables are created outside of Mbed OS.
Also remove "gdb_memory_map disable" command that breaks breakpoints.pull/15339/head
parent
e607b7909f
commit
a9be092438
|
|
@ -35,9 +35,7 @@ set(PYOCD_CLOCK_SPEED 4000k)
|
|||
|
||||
set(OPENOCD_UPLOAD_ENABLED TRUE)
|
||||
set(OPENOCD_CHIP_CONFIG_COMMANDS
|
||||
-f ${CMAKE_CURRENT_LIST_DIR}/openocd_cfgs/stm32f429-disco.cfg
|
||||
-c "gdb_memory_map disable" # prevents OpenOCD crash on GDB connect
|
||||
)
|
||||
-f ${CMAKE_CURRENT_LIST_DIR}/openocd_cfgs/stm32f429-disco.cfg)
|
||||
|
||||
# Config options for STM32Cube
|
||||
# -------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -37,7 +37,6 @@ set(PYOCD_CLOCK_SPEED 4000k)
|
|||
set(OPENOCD_UPLOAD_ENABLED TRUE)
|
||||
set(OPENOCD_CHIP_CONFIG_COMMANDS
|
||||
-f ${CMAKE_CURRENT_LIST_DIR}/openocd_cfgs/stm32l452re.cfg
|
||||
-c "gdb_memory_map disable" # prevents OpenOCD crash on GDB connect
|
||||
)
|
||||
|
||||
# Config options for STM32Cube
|
||||
|
|
|
|||
|
|
@ -29,17 +29,18 @@ message(STATUS "Board upload method set to ${UPLOAD_METHOD}")
|
|||
# ----------------------------------------------
|
||||
# Generate gdbinit if needed
|
||||
|
||||
# path where the gdbinit file will be written
|
||||
set(GDBINIT_PATH ${CMAKE_CURRENT_BINARY_DIR}/mbed-cmake.gdbinit)
|
||||
|
||||
if(UPLOAD_SUPPORTS_DEBUG)
|
||||
# create init file for GDB client
|
||||
file(GENERATE OUTPUT ${GDBINIT_PATH} CONTENT
|
||||
file(GENERATE OUTPUT ${CMAKE_BINARY_DIR}/mbed-cmake.gdbinit CONTENT
|
||||
"# connect to GDB server
|
||||
target remote localhost:${GDB_PORT}
|
||||
")
|
||||
endif()
|
||||
|
||||
# UPLOAD_SUPPORTS_DEBUG needs to be made into a cache variable so that it can
|
||||
# be seen by higher level directories when they call mbed_generate_upload_debug_targets()
|
||||
set(MBED_UPLOAD_SUPPORTS_DEBUG ${UPLOAD_SUPPORTS_DEBUG} CACHE INTERNAL "" FORCE)
|
||||
|
||||
# ----------------------------------------------
|
||||
# Function for creating targets
|
||||
|
||||
|
|
@ -48,11 +49,11 @@ function(mbed_generate_upload_debug_targets target)
|
|||
gen_upload_target(${target} ${CMAKE_CURRENT_BINARY_DIR}/${target}.bin ${CMAKE_CURRENT_BINARY_DIR}/${target}.hex)
|
||||
|
||||
# add debug target
|
||||
if(UPLOAD_SUPPORTS_DEBUG)
|
||||
if(MBED_UPLOAD_SUPPORTS_DEBUG)
|
||||
add_custom_target(debug-${target}
|
||||
COMMENT "starting GDB to debug ${target}..."
|
||||
COMMAND arm-none-eabi-gdb
|
||||
--command=${GDBINIT_PATH}
|
||||
--command=${CMAKE_BINARY_DIR}/mbed-cmake.gdbinit
|
||||
$<TARGET_FILE:${target}>
|
||||
USES_TERMINAL)
|
||||
endif()
|
||||
|
|
|
|||
Loading…
Reference in New Issue