forked from nuttx/nuttx-update
tools/gdb: add utils.get_tid(tcb)
Signed-off-by: huangyin5 <huangyin5@xiaomi.com>
This commit is contained in:
parent
69613d5199
commit
1e265af8eb
1 changed files with 10 additions and 0 deletions
|
@ -561,6 +561,16 @@ def get_tcb(pid):
|
||||||
return tcb
|
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):
|
def get_task_name(tcb):
|
||||||
try:
|
try:
|
||||||
name = tcb["name"].cast(gdb.lookup_type("char").pointer())
|
name = tcb["name"].cast(gdb.lookup_type("char").pointer())
|
||||||
|
|
Loading…
Reference in a new issue