This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 400790d40bfa63684f0c123efe537204c6edfdc5
Author: yangao1 <[email protected]>
AuthorDate: Thu Oct 10 17:29:49 2024 +0800

    tools/gdb/gdbinit.py:add hint
    
    Signed-off-by: yangao1 <[email protected]>
---
 tools/gdb/nuttxgdb/__init__.py | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/tools/gdb/nuttxgdb/__init__.py b/tools/gdb/nuttxgdb/__init__.py
index d4b5038a1a..339af63dd9 100644
--- a/tools/gdb/nuttxgdb/__init__.py
+++ b/tools/gdb/nuttxgdb/__init__.py
@@ -51,16 +51,16 @@ def register_commands(event):
     def init_gdb_commands(m: str):
         try:
             module = importlib.import_module(f"{__package__}.{m}")
-        except Exception:
-            gdb.write(f"\x1b[31;1mIgnore module: {m}\n\x1b[m")
+        except Exception as e:
+            gdb.write(f"\x1b[31;1mIgnore module: {m}, error: {e}\n\x1b[m")
             return
 
         for c in module.__dict__.values():
             if isinstance(c, type) and issubclass(c, gdb.Command):
                 try:
                     c()
-                except Exception:
-                    gdb.write(f"\x1b[31;1mIgnore command: {c}\n\x1b[m")
+                except Exception as e:
+                    gdb.write(f"\x1b[31;1mIgnore command: {c}, e: {e}\n\x1b[m")
 
     # import utils module
     utils = importlib.import_module(f"{__package__}.utils")
@@ -79,6 +79,7 @@ def register_commands(event):
 
 
 if len(gdb.objfiles()) == 0:
+    gdb.write("No objectfile, defer to register NuttX commands.\n")
     gdb.events.new_objfile.connect(register_commands)
 else:
     register_commands(None)

Reply via email to