Commit b4b6ba09 authored by Tristan Gingold's avatar Tristan Gingold

Document mockturtle-debug tool.

parent fea886af
......@@ -22,3 +22,4 @@ message.
mockturtle-ping
mockturtle-variable
mockturtle-buffer
mockturtle-debug
.. _`tools:mockturtle-debug`:
====================
Mock Turtle Debugger
====================
The Mock Turtle Debugger agent (*mockturtle-debug.py*) is
used to debug a CPU with the cross gdb (*riscv32-elf-gdb*).
The debugger agent is a standalone gdb server that implements the
remote protocol. It is standalone because it doesn't need any linux
device driver and relies of the Universal Access Library (UAL) to do
hardware accesses.
You need to start the debug agent on the host that drives the Mock Turtle.
The options for the agent are:
``-b vme``
Use the VME bus to access to the Mock Turtle. This option is required.
``-o OFFSET``
Set the base address of the Mock Turtle in the selected bus.
``-c CPU``
Select the cpu core, or use core 0 if this option is not present.
``-t``
Disable output of the debug uart. By default the debug agent will display
the characters sent over the debug uart while the program is running on the
core. This option turns off this feature.
The debug agent will create a TCP socket and listen on it on port 3000 for
a connection from gdb. It displays this message before listening:
.. code-block:: none
Waiting for connection on port 3000
At that point you can start the cross debugger on the host where you have compiled your program. Don't forget to enable the generation of debug information:
.. code-block:: none
riscv32-elf-gdb ./myprog.elf
Then you have to connect to the debug agent (replace `address` by the name of
the target machine which runs the debug agent):
.. code-block:: none
(gdb) target remote address:3000
It is possible to load the program directly, and you should load
before restarting a program to be sure about the state of it:
.. code-block:: none
(gdb) load
The execution is started with the `continue` command:
.. code-block:: none
(gdb) c
The usual gdb commands are available: you can set a breakpoint,
display the backtrace, inspect registers, display a variable, do a
single step, execute until the next line... Refer to the gdb manual
or any gdb tutorial.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment