magictpa icon indicating copy to clipboard operation
magictpa copied to clipboard

Trace port extention for GDB

Black Magic Trace Extention for GDB (MagicTPA) Copyright (C) 2012 Black Sphere Technologies Ltd.

License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html

This is an experimental extension to GDB providing trace support on ARM Cortex-M microcontrollers with the Black Magic Probe. It is still very experimental and may not be useful. It is provided for the brave ones who are keen to hack at it and improve it.

Firmware support is provided by the Black Magic Probe: https://github.com/gsmcmullin/blackmagic.git

To install, copy the magictpa directory from here to your GDB python directory '/share/gdb/python'. MagicTPA can be tried out and worked on without installing by adding the repo directory to your PYTHONPATH environment variable.

To load the extension from GDB, use the command 'python import magictpa'. The correct sequence must be followed:

.gdbinit example

set target-async on set mem inaccessible-by-default off target extended-remote ... monitor swdp_scan attach 1 python import magictpa

end of example

The following GDB commands are added by the module to provide trace: set tpa speed -- Sets the trace port speed. Written to TPIU_ACPR on target. set tpa log -- Record decoded trace events to set tpa echo (on|off) -- Write decoded trace events to stdout when logging. set tpa gate (on|off) -- Only process trace events when the target is running. set tpa rawfile -- Record raw (binary) trace stream to a file. set tpa time (off|host|delta) -- Timestamping to use for recording events. tpa watch [pc] -- Trace changes to variable. tpa delete -- Remove trace source .