forked from openweave/openweave-nrf52840-lock-example
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gdb-startup-cmds.txt
38 lines (32 loc) · 1.08 KB
/
gdb-startup-cmds.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# Set convenience vars for the start and end of the .text section
set $FLASH_START=&__isr_vector
set $FLASH_END=&__etext
# Search for the signature string indicating that the app was built with support
# for J-Link monitor mode debugging.
set logging file /dev/null
set logging redirect on
set logging on
find /b1 $FLASH_START, $FLASH_END, 'J', 'L', 'I', 'N', 'K', 'M', 'O', 'N', 'H', 'A', 'N', 'D', 'L', 'E', 'R'
set logging off
set logging redirect off
# Tell the user which type of debugging will being used.
if $numfound != 0
echo J-LINK monitor handler detected: Enabling monitor mode debugging\n
else
echo J-LINK monitor handler NOT detected: Using standard 'HALT' mode debugging\n
end
# Connect to the GDB server
echo Connecting to local GDB server\n
target remote localhost:2331
# Enable monitor mode debugging if available.
set logging file /dev/null
set logging redirect on
set logging on
if $numfound != 0
mon exec SetMonModeDebug=1
eval "mon exec SetMonModeVTableAddr=%p", $FLASH_START
else
mon exec SetMonModeDebug=0
end
set logging off
set logging redirect off