J-Link / J-Trace (UM08001) © 2004-2017 SEGGER Microcontroller GmbH & Co. KG
463
19.5 Enabling semihosting in J-Link GDBServer
By default, semihosting is disabled in J-Link GDBServer. Depending on the mecha-
nism to be used, different setups are necessary
19.5.1 SVC variant
The following commands need to be added to the gdbinit file that is executed at the
start of a debug session:
monitor semihosting enable
monitor semihosting breakOnError
monitor semihosting IOclient 3
monitor semihosting setargs "<argv>" (in case SYS_GET_CMDLINE command is used)
For more detailed information about the monitor commands supported by J-Link
GDBServer, please refer to
Supported remote (monitor) commands on page 98.
19.5.2 Breakpoint variant
The following commands need to be added to the gdbinit file that is executed at the
start of a debug session:
monitor semihosting enable
19.5.3 J-Link GDBServer optimized variant
The following commands need to be added to the gdbinit file that is executed at the
start of a debug session:
monitor semihosting enable <AddrSemiBreak>
Please also make sure that an appropriate SVC exception handler is linked in the
application. For sample code, please refer to
SVC exception handler sample code on
page 457.