From 1ed805a7e6e89b488f65cd4aa675874a8e704674 Mon Sep 17 00:00:00 2001 From: Vanhala Antti Date: Mon, 31 Mar 2014 15:09:07 +0300 Subject: [PATCH] Add an option to run mappers inside gdb --- mapper/start-mappers.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mapper/start-mappers.sh b/mapper/start-mappers.sh index d3f905e..a08da4e 100755 --- a/mapper/start-mappers.sh +++ b/mapper/start-mappers.sh @@ -22,5 +22,9 @@ do # Disable tun interface sed -i 's/"type": "TUNInterface"/\/\/"type": "TUNInterface"/g' $file - $cjdns_path/cjdroute < $file + if [[ $* == *-d* ]]; then + gdb $cjdns_path/cjdroute -ex 'set follow-fork-mode child' -ex 'run < '"${file}" -ex 'thread apply all bt' -ex 'quit' 2>&1 | tee gdb-$i.log & + else + $cjdns_path/cjdroute < $file + fi done