XuNeo opened a new pull request, #14919:
URL: https://github.com/apache/nuttx/pull/14919

   *Note: Please adhere to [Contributing 
Guidelines](https://github.com/apache/nuttx/blob/master/CONTRIBUTING.md).*
   
   ## Summary
   
   Minor update to gdbinit.
   1. Guide user to source `gdb/gdbinit.py` instead of the original 
`gdb/__init__.py`
   2. Ignore commands that has error and continue to register the remaining 
commands. This normally happen when some modules are disabled.
   3. Show backtrace of why the command failed to register.
   
   ## Impact
   
   No.
   
   ## Testing
   
   Tested with qemu arm64.
   ```
   (gdb) source nuttx/tools/gdb/nuttxgdb/__init__.py
   Use nuttx/tools/gdb/gdbinit.py instead%
   ```
   Now it will exit and print error message.
   
   Manually introduce an error in fs.py and it can correctly report.
   ```
   Ignore module: fs, error: unterminated string literal (detected at line 33) 
(fs.py, line 33)
   Traceback (most recent call last):
     File "/home/neo/projects/nuttx/nuttx/tools/gdb/nuttxgdb/__init__.py", line 
54, in init_gdb_commands
       module = importlib.import_module(f"{__package__}.{m}")
     File "/usr/lib/python3.10/importlib/__init__.py", line 126, in 
import_module
       return _bootstrap._gcd_import(name[level:], package, level)
     File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
     File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
     File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
     File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
     File "<frozen importlib._bootstrap_external>", line 879, in exec_module
     File "<frozen importlib._bootstrap_external>", line 1017, in get_code
     File "<frozen importlib._bootstrap_external>", line 947, in source_to_code
     File "<frozen importlib._bootstrap>", line 241, in 
_call_with_frames_removed
     File "/home/neo/projects/nuttx/nuttx/tools/gdb/nuttxgdb/fs.py", line 33
       I'm an error.
        ^
   SyntaxError: unterminated string literal (detected at line 33)
   Load macro: 
/home/neo/projects/nuttx/build/8df01f54a9bf37445496eac21bd282fa.json
   
    if use thread command, please don't use 'continue', use 'c' instead !!!
    if use thread command, please don't use 'step', use 's' instead !!!
   Build version:  "9f9cc7ecebd-dirty Nov 24 2024 19:24:07"
   
   Remote debugging using :1127
   0x00000000402cb73c in up_idle () at 
/home/neo/projects/nuttx/nuttx/arch/arm64/src/common/arm64_idle.c:63
   63      }
   
   ```
   
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to