1
0
Fork 0
forked from nuttx/nuttx-update

tools/gdb: add utils.get_tid(tcb)

Signed-off-by: huangyin5 <huangyin5@xiaomi.com>
This commit is contained in:
huangyin5 2024-09-29 16:10:23 +08:00 committed by Xiang Xiao
parent 69613d5199
commit 1e265af8eb

View file

@ -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())