summaryrefslogtreecommitdiffstats
path: root/Documentation/user/debugging.rst
blob: 15cb4390439875463f8cea351e89c9b747f239c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Debugging with OpenOCD
======================

Barebox can be configured to break on prebootloader and main barebox entry. This
breakpoint can not be resumed and will stop the board to allow the user to
attach a JTAG debugger with OpenOCD. Additionally, barebox provides helper
scripts to load the symbols from the ELF binaries.
The python scripts require `pyelftools`.
To load the scripts into your gdb session, run the following command in the
barebox directory:

.. code-block:: none

    (gdb) source scripts/gdb/helper.py

This makes two new commands available in gdb, `bb-load-symbols` and
`bb-skip-break`. `bb-load-symbols` can load either the main `barebox` file or
one of the .pbl files in the image directories. The board needs to be stopped in
either the prebootloader or main barebox breakpoint, and gdb needs to be
connected to OpenOCD. To continue booting the board, `bb-skip-break` jumps over
the breakpoint and continues the barebox execution.