GDB with Python
We can better debug the nuttx kernel through GDB’s python extension. Some of the most common class usages are implemented under the nuttx/tools/gdb directory. Users can write their own python scripts to debug the nuttx kernel according to their needs
Compile nuttx with CONFIG_DEBUG_SYMBOLS=y
Use gdb to debug nuttx elf.(real device, or sim, or coredump)
add args to gdb command line: -ix=”nuttx/tools/gdb/__init__.py”
Then gdb will load the python script automatically.you can use the custom commands.
How to write a GDB python script
Here is an article to introduce, read it to understand the most basic principles of python, Automate Debugging with GDB Python API.
For more documentation on gdb python, please refer to the official documentation of gdb GDB with python.