Python module for operating with freeRTOS-kernel objects in GDB
Low maintenance activity. Last release 22 months ago, commits in 0 of the last 26 weeks. Weaker on commit activity and recent releases.
$
pip install freertos-gdbFreertos-gdb
Python module for user-friendly view freeRTOS-kernel objects in GDB
Requirements
GDB must built with python 3.6+ support
Check your GDB with command:
gdb -q -ex "python print('OK' if sys.version_info.major==3 and sys.version_info.minor>=6 else 'NOT SUPPORTED')" -ex "quit"
Install
- Install the distro using
pip
pip install freertos-gdb
Run
Start GDB and run the command
python import freertos_gdb
Also, you could just update .gdbinit with this command
Possible problems and solutions
ModuleNotFoundError
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'freertos_gdb'
Error while executing Python code.
Solution
Check your sys.path inside GDB shell
python import sys; print(sys.path)
Append sys.path with a path to directory which contains freertos_gdb module.
Or execute GDB with right PYTHONPATH env variable
Commands
You have freertos command with subcommands inside:
(gdb) freertos
"freertos" must be followed by the name of a subcommand.
List of freertos subcommands:
freertos queue -- Generate a print out of the current queues info.
freertos semaphore -- Generate a print out of the current semaphores info.
freertos task -- Generate a print out of the current tasks and their states.
freertos timer -- Generate a print out of the current timers info.
....
Examples
Tasks
(gdb) freertos task
CPU - Processing on CPU number
ID - TCB_t task memory address
PRI - Task priority
B_PRI - Base priority.
SS - Stack size.
SL - Stack limit (available space left).
CPU ID NAME STATUS PRI B_PRI MUTEXES_HELD SS SL
----- ---------- --------- --------- ----- ------- -------------- ---- ----
CPU0 0x3ffb6674 IDLE ready 0 0 0 1104 428
0x3ffb6dd4 IDLE ready 0 0 0 1104 428
CPU1 0x3ffbb724 SEM_RECUR ready 6 6 1 1680 364
0x3ffafd14 ipc0 suspended 24 24 0 564 456
0x3ffb4db4 esp_timer suspended 22 22 0 3648 444
0x3ffb3c54 ipc1 suspended 24 24 0 592 428
0x3ffb7734 Tmr Svc delayed_1 1 1 0 1584 460
0x3ffaf83c SENDER1 delayed_1 6 6 0 1600 444
0x3ffaf998 SENDER2 delayed_1 6 6 0 1548 496
0x3ffb909c READER1 delayed_1 6 6 0 1608 436
0x3ffb99fc READER2 delayed_1 6 6 0 1608 436
0x3ffba35c SEM_BIN1 delayed_1 6 6 0 1624 420
0x3ffbacbc SEM_BIN2 delayed_1 6 6 0 1592 452