You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactor upload methods to streamline the debugging experience (ARMmbed#129)
* Change all debug configurations to not reset and exit on error. Initial tasks.json implementation.
* st-util working on command line and VS Code!
* Convert STM32CUBE, fix spaces in GDB server task command
* pyocd working!
* Convert OpenOCD
* Convert JLINK
* Convert REDLINK upload method
* Fix CMake typo
* Try and fix some variable scope issues
* Initial CLion implementation. Need to test with hardware.
* Add a separate task that kicks off a build before each debug session
# use a higher numbered port to allow use without root on Linux/Mac
15
15
set(GDB_PORT23331CACHESTRING"Port that the GDB server will be started on.")
16
16
17
+
# Load the upload method. This is expected to set the following variables:
18
+
# UPLOAD_${UPLOAD_METHOD}_FOUND - True iff the dependencies for this upload method were found
19
+
# UPLOAD_SUPPORTS_DEBUG - True iff this upload method supports debugging
20
+
# UPLOAD_GDBSERVER_DEBUG_COMMAND - Command to start a new GDB server
21
+
# UPLOAD_WANTS_EXTENDED_REMOTE - True iff GDB should use "target extended-remote" to connect to the GDB server
22
+
# UPLOAD_LAUNCH_COMMANDS - List of GDB commands to run after launching GDB.
23
+
# UPLOAD_RESTART_COMMANDS - List of commands to run when the "restart chip" function is used.
24
+
# See here for more info: https://github.com/mbed-ce/mbed-os/wiki/Debugger-Commands-and-State-in-Upload-Methods
17
25
include(UploadMethod${UPLOAD_METHOD})
18
26
19
27
if(NOT"${UPLOAD_${UPLOAD_METHOD}_FOUND}")
@@ -24,46 +32,27 @@ if(NOT (("${UPLOAD_METHOD}" STREQUAL NONE) OR ("${${UPLOAD_METHOD}_UPLOAD_ENABLE
24
32
message(FATAL_ERROR"The upload method ${UPLOAD_METHOD} is not enabled in the config code for this target -- set ${UPLOAD_METHOD}_UPLOAD_ENABLED to TRUE to enable it.")
25
33
endif()
26
34
27
-
message(STATUS"Board upload method set to ${UPLOAD_METHOD}")
message(STATUS"Detected CLion IDE, will generate CLion debug configurations")
10
+
message(STATUS"Mbed: Detected CLion IDE, will generate CLion debug configurations")
11
11
set(MBED_GENERATE_CLION_DEBUG_CFGSTRUE)
12
12
13
+
set(MBED_CLION_PROFILE_NAME""CACHESTRING"Name of the Clion build profile (Settings > Build, Execution, Deployment > CMake > Name textbox")
14
+
15
+
if(MBED_CLION_PROFILE_NAMESTREQUAL"")
16
+
message(FATAL_ERROR"In order to generate CLion configuration files, Mbed CE needs to know the name of the current CLion build profile. This name is the string typed into the Name textbox under Settings > Build, Execution, Deployment > CMake. Pass this name with '-DMBED_CLION_PROFILE_NAME=<name>'.")
17
+
endif()
18
+
13
19
elseif(CMAKE_EXPORT_COMPILE_COMMANDS) # TODO: Is this actually a reliable way of detecting VS Code? Not sure if it will create false positives.
14
-
message(STATUS"Detected VS Code IDE, will generate VS Code debug configurations")
20
+
message(STATUS"Mbed: Detected VS Code IDE, will generate VS Code debug configurations")
15
21
set(MBED_GENERATE_VS_CODE_DEBUG_CFGSTRUE)
16
22
23
+
elseif(MBED_UPLOAD_SUPPORTS_DEBUG)
24
+
message(STATUS"Mbed: No IDE detected, will generate configurations for command-line debugging (e.g. ninja gdbserver, then ninja debug-SomeProgram)")
0 commit comments