summaryrefslogtreecommitdiff
path: root/scripts/debug
diff options
context:
space:
mode:
authorNathaniel Graff <nathaniel.graff@sifive.com>2019-03-06 13:08:22 -0800
committerNathaniel Graff <nathaniel.graff@sifive.com>2019-03-06 13:39:36 -0800
commit6aab6996dbd890c5788bf4e330454a3490268174 (patch)
tree83596e3e6ed4d1fa832f6771cdee2ee35c070b95 /scripts/debug
parentcc49f2721ad0c59ce829b4547644345e7a399068 (diff)
Add support for Segger J-Link
Signed-off-by: Nathaniel Graff <nathaniel.graff@sifive.com>
Diffstat (limited to 'scripts/debug')
-rwxr-xr-xscripts/debug13
1 files changed, 12 insertions, 1 deletions
diff --git a/scripts/debug b/scripts/debug
index d02c42c..87068c5 100755
--- a/scripts/debug
+++ b/scripts/debug
@@ -5,6 +5,7 @@ set -o pipefail
unset elf
unset cfg
+unset jlink
unset openocd
unset gdb
while [[ "$1" != "" ]]
@@ -13,13 +14,14 @@ do
in
--elf) elf="$2"; shift 2;;
--openocd) openocd="$2"; shift 2;;
+ --jlink) jlink="$2"; shift 2;;
--openocd-config) cfg="$2"; shift 2;;
--gdb) gdb="$2"; shift 2;;
*) echo "$0: Unknown argument $1"; exit 1;;
esac
done
-if [[ "$elf" == "" ]]
+if [ "$elf" == "" ]
then
echo "$0: --elf is required" >&2
exit 1
@@ -27,8 +29,17 @@ fi
export GDB_PORT=3333
+if [ "$jlink" != "" ]
+then
+
+$jlink -device RISC-V -port $GDB_PORT &
+
+else
+
$openocd -f $cfg &
+fi
+
$gdb $elf -ex "set remotetimeout 240" -ex "target extended-remote localhost:${GDB_PORT}"
kill %1