From 1e265af8ebc90ed3353614300640abeda08a80b6 Mon Sep 17 00:00:00 2001 From: huangyin5 Date: Sun, 29 Sep 2024 16:10:23 +0800 Subject: [PATCH] tools/gdb: add utils.get_tid(tcb) Signed-off-by: huangyin5 --- 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())