@@ -86,7 +86,7 @@ if(MBED_GENERATE_CLION_DEBUG_CFGS)
8686" )
8787 endfunction (mbed_generate_ide_debug_configuration)
8888
89- function (mbed_finalize_ide_debug_configurations)
89+ function (mbed_finalize_ide_debug_configurations CMAKE_TARGET )
9090 # Don't need to do anything
9191 endfunction (mbed_finalize_ide_debug_configurations)
9292
@@ -163,7 +163,7 @@ elseif(MBED_GENERATE_VS_CODE_DEBUG_CFGS)
163163 endfunction (mbed_generate_ide_debug_configuration)
164164
165165 # Take all generated debug configurations and write them to launch.json.
166- function (mbed_finalize_ide_debug_configurations)
166+ function (mbed_finalize_ide_debug_configurations CMAKE_TARGET )
167167
168168 set (VSCODE_LAUNCH_JSON_PATH ${CMAKE_SOURCE_DIR} /.vscode/launch.json)
169169
@@ -246,15 +246,14 @@ elseif(MBED_UPLOAD_SUPPORTS_DEBUG)
246246 add_custom_target (debug-${target}
247247 COMMENT "Starting GDB to debug ${target} ..."
248248 COMMAND ${MBED_GDB}
249- --command =${CMAKE_BINARY_DIR} /mbed-cmake.gdbinit
249+ --command =${CMAKE_BINARY_DIR} /mbed-cmake$<$< BOOL : ${CMAKE_TARGET} >:- ${CMAKE_TARGET} > .gdbinit
250250 $<TARGET_FILE:${target} >
251251 USES_TERMINAL )
252252 endif ()
253253
254254 endfunction (mbed_generate_ide_debug_configuration)
255255
256- function (mbed_finalize_ide_debug_configurations)
257-
256+ function (mbed_finalize_ide_debug_configurations CMAKE_TARGET)
258257 # create init file for GDB client
259258 if (MBED_UPLOAD_WANTS_EXTENDED_REMOTE)
260259 set (UPLOAD_GDB_REMOTE_KEYWORD "extended-remote" )
@@ -264,7 +263,7 @@ elseif(MBED_UPLOAD_SUPPORTS_DEBUG)
264263
265264 list (JOIN MBED_UPLOAD_LAUNCH_COMMANDS "\n " MBED_UPLOAD_LAUNCH_COMMANDS_FOR_GDBINIT)
266265
267- file (GENERATE OUTPUT ${CMAKE_BINARY_DIR} /mbed-cmake.gdbinit CONTENT
266+ file (GENERATE OUTPUT ${CMAKE_BINARY_DIR} /mbed-cmake$<$< BOOL : ${CMAKE_TARGET} >:- ${CMAKE_TARGET} > .gdbinit CONTENT
268267"# connect to GDB server
269268target ${UPLOAD_GDB_REMOTE_KEYWORD} 127.0.0.1:${GDB_PORT}
270269${MBED_UPLOAD_LAUNCH_COMMANDS_FOR_GDBINIT}
@@ -285,7 +284,7 @@ else()
285284 function (mbed_generate_ide_debug_configuration CMAKE_TARGET)
286285 endfunction ()
287286
288- function (mbed_finalize_ide_debug_configurations)
287+ function (mbed_finalize_ide_debug_configurations CMAKE_TARGET )
289288 endfunction ()
290289
291290endif ()
0 commit comments