aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/gdb/linux/tasks.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/gdb/linux/tasks.py')
-rw-r--r--scripts/gdb/linux/tasks.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/scripts/gdb/linux/tasks.py b/scripts/gdb/linux/tasks.py
index 862a4ae24d49..1bf949c43b76 100644
--- a/scripts/gdb/linux/tasks.py
+++ b/scripts/gdb/linux/tasks.py
@@ -114,3 +114,22 @@ variable."""
114 114
115 115
116LxThreadInfoFunc() 116LxThreadInfoFunc()
117
118
119class LxThreadInfoByPidFunc (gdb.Function):
120 """Calculate Linux thread_info from task variable found by pid
121
122$lx_thread_info_by_pid(PID): Given PID, return the corresponding thread_info
123variable."""
124
125 def __init__(self):
126 super(LxThreadInfoByPidFunc, self).__init__("lx_thread_info_by_pid")
127
128 def invoke(self, pid):
129 task = get_task_by_pid(pid)
130 if task:
131 return get_thread_info(task.dereference())
132 else:
133 raise gdb.GdbError("No task of PID " + str(pid))
134
135LxThreadInfoByPidFunc()