===== Using the GDB with deep ====== OpenOCD must already be [[openocd:starting_openocd|running]] if the gdb is to be started. The following script can be used to start the gdb: $Env:Path += ";D:\GNUArmEmbeddedToolchain\6-2017-q2-update\bin" cd C:\WorkingDir arm-none-eabi-gdb --command=gdbInit.txt * In the first line, the installation path must be adapted. * The "WorkingDir" is the path where the compiled deep application is located. The "gdbInit.txt" contains commands that are processed one after the other when gdb is started. Of course, these can be adapted. **gdbInit.txt:** set extension-language .java minimal file M:/MA/stabs/loopWithSTABS dir M:/MA/stabs/ target remote localhost:3333 monitor reset halt #monitor halt load monitor reg pc 0 * ''set extension-language.java minimal'' configures the gdb to accept *.java source code * ''file'' loads the compiled deep application as binary image or ELF file * ''dir'' defines the WorkingDir for the gdb. This is particularly relevant for source lookup. * ''target remote localhost:3333'' connects the gdb to OpenOCD * '''monitor reset halt'' uses the OpenOCD command ''halt'' to reset and stop the target * '''load'' loads the machine code directly to the target * ''monitor reg pc 0'' sets the program counter to 0