Created
March 6, 2024 17:56
-
-
Save stefanct/c4fb49a7b835c3eaf74aed6547455c87 to your computer and use it in GitHub Desktop.
cmake: create a debug target that launches gdb and a respective gdbserver
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_custom_target ( | |
${PROJECT_NAME}_debug | |
DEPENDS .${PROJECT_NAME}_gdbserver | |
COMMAND gdb-multiarch | |
-ex "target extended-remote :3333" | |
-ex "load" | |
-ex "monitor reset" | |
--args $<TARGET_FILE:${PROJECT_NAME}> | |
) | |
add_custom_target ( | |
.${PROJECT_NAME}_gdbserver | |
COMMAND sh -c "gdbserver-path and arguments &" | |
VERBATIM | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment