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 1e265af8ebc90ed3353614300640abeda08a80b6
Author: huangyin5 <[email protected]>
AuthorDate: Sun Sep 29 16:10:23 2024 +0800

    tools/gdb: add utils.get_tid(tcb)
    
    Signed-off-by: huangyin5 <[email protected]>
---
 tools/gdb/nuttxgdb/utils.py | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/tools/gdb/nuttxgdb/utils.py b/tools/gdb/nuttxgdb/utils.py
index 8ae16c7b58..394a0fa84f 100644
--- a/tools/gdb/nuttxgdb/utils.py
+++ b/tools/gdb/nuttxgdb/utils.py
@@ -561,6 +561,16 @@ def get_tcb(pid):
     return tcb
 
 
+def get_tid(tcb):
+    """get tid from tcb"""
+    if not tcb:
+        return None
+    try:
+        return tcb["group"]["tg_pid"]
+    except gdb.error:
+        return None
+
+
 def get_task_name(tcb):
     try:
         name = tcb["name"].cast(gdb.lookup_type("char").pointer())

Reply via email to