From 1dfcb1f12d50cf1b0a5dda7b92cb9de99fb5ed3d Mon Sep 17 00:00:00 2001 From: anjiahao Date: Tue, 20 Jun 2023 20:36:19 +0800 Subject: [PATCH] Documentation:Add documentation related to gdb python script debugging Signed-off-by: anjiahao --- Documentation/guides/gdbwithpython.rst | 27 ++++++++++++++++++++++++++ Documentation/guides/index.rst | 1 + 2 files changed, 28 insertions(+) create mode 100644 Documentation/guides/gdbwithpython.rst diff --git a/Documentation/guides/gdbwithpython.rst b/Documentation/guides/gdbwithpython.rst new file mode 100644 index 00000000000..596c905e3f4 --- /dev/null +++ b/Documentation/guides/gdbwithpython.rst @@ -0,0 +1,27 @@ +==================== +GDB with Python +==================== + +Introduction +============ + +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 + +Usage +===== + +1. Compile nuttx with CONFIG_DEBUG_SYMBOLS=y +2. Use gdb to debug nuttx elf.(real device, or sim, or coredump) +3. add args to gdb command line: -ix="nuttx/tools/gdb/__init__.py" +4. 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 pyhton, please refer to the official documentation of gdb +`GDB with pyhton `_. diff --git a/Documentation/guides/index.rst b/Documentation/guides/index.rst index a669fd04292..f6e49584198 100644 --- a/Documentation/guides/index.rst +++ b/Documentation/guides/index.rst @@ -20,3 +20,4 @@ Guides nestedinterrupts.rst cortexmhardfaults.rst coredump.rst + gdbwithpython.rst