1 # gdb-remote.init file for IDE
2 # Object: allow to use standard gdb to remote debug a target
3 # Usage: remote-target-populate update script under ./build directory
4 # Author: Fulup Ar Foll (IoT.bzh)
5 # Reference: https://blog.flameeyes.eu/2010/02/remote-debugging-with-gdb-part-2-gdb/
8 # - on target start with $GDB ./target/gdb-cross-root@$TARGET.ini
9 # - Netbeans impose debug-command to point on a local instance of afb-daemon binary
10 # - --ldpath should be absolute as solib-search-path refuse to work as documented
12 # xds-gdb annotation to point where it should
13 # :XDS-ENV: XDS_PROJECT_ID=@XDS_PROJECT_ID@
14 # :XDS-ENV: XDS_SDK_ID=@XDS_SDK_ID@
15 # :XDS-ENV: XDS_SERVER_URL=@XDS_SERVER_URL@
17 # Start gdbserver on target and connect through SSH link WARNING:
18 target remote | ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null @RSYNC_TARGET@ gdbserver - \
19 /usr/bin/afb-daemon --port=@AFB_REMPORT@ --workdir=@RSYNC_PREFIX@/@PROJECT_NAME@ --roothttp=htdocs --ldpaths=@RSYNC_PREFIX@/@PROJECT_NAME@/lib --verbose --token=@AFB_TOKEN@
21 # Disable auto answer no on questions and to set breakpoint
24 # Disable auto load of libraries to improved perf
25 set auto-solib-add off
27 # Define path for project libraries
28 set solib-search-path ${PROJECT_PKG_BUILD_DIR}
30 # Replace run by continue done by xds-gdb
32 # Manually load project libraries when loaded by afb-daemon
33 tbreak @GDB_INITIAL_BREAK@
35 sharedlibrary @RSYNC_PREFIX@/@PROJECT_NAME@