aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsprhawk <hongbo@yang.me>2014-09-01 10:22:53 +0800
committersprhawk <hongbo@yang.me>2014-09-01 10:22:53 +0800
commitadf5f50774809cb999146e94a4535a86f955bac5 (patch)
treeb003dad7d1aceab09e7fee458767176393cb1396
parent536c2d68a92b6925dd2890139b069eac4858856e (diff)
downloadnrf51822-posix-build-scripts-adf5f50774809cb999146e94a4535a86f955bac5.tar.gz
nrf51822-posix-build-scripts-adf5f50774809cb999146e94a4535a86f955bac5.tar.bz2
nrf51822-posix-build-scripts-adf5f50774809cb999146e94a4535a86f955bac5.tar.xz
nrf51822-posix-build-scripts-adf5f50774809cb999146e94a4535a86f955bac5.zip
added gdbserver / gdb support
-rw-r--r--Makefile.common14
1 files changed, 14 insertions, 0 deletions
diff --git a/Makefile.common b/Makefile.common
index 424a4d1..0841ff9 100644
--- a/Makefile.common
+++ b/Makefile.common
@@ -260,3 +260,17 @@ $(OUTPUT_BINARY_DIRECTORY)/pinreset.jlink: $(BUILD_DIRECTORIES)
pin-reset: $(OUTPUT_BINARY_DIRECTORY)/pinreset.jlink
$(JLINK) -CommanderScript $(OUTPUT_BINARY_DIRECTORY)/pinreset.jlink; [ "$$?" -eq 1 ]
+
+START_GDB_SERVER_SCRIPT=$(OUTPUT_BINARY_DIRECTORY)/start_gdbserver.sh
+$(START_GDB_SERVER_SCRIPT): $(BUILD_DIRECTORIES)
+ echo "JLinkGDBServer -if swd -device nrf51822" > $(START_GDB_SERVER_SCRIPT)
+
+gdbserver: $(START_GDB_SERVER_SCRIPT)
+ /bin/sh $(START_GDB_SERVER_SCRIPT)
+
+START_GDB_SCRIPT=$(OUTPUT_BINARY_DIRECTORY)/gdb.sh
+$(START_GDB_SCRIPT): $(BUILD_DIRECTORIES)
+ echo 'arm-none-eabi-gdb -ex "target remote localhost:2331"' > $(START_GDB_SCRIPT)
+
+gdb: $(START_GDB_SCRIPT)
+ /bin/sh $(START_GDB_SCRIPT)