git://scm.lunaixsky.com
/
lunaix-os.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
43d947a3df4a1342d409aaf68863084ae38203c5
[lunaix-os.git]
/
lunaix-os
/
scripts
/
gdb
/
lunadbg
/
utils.py
1
import gdb
2
3
def pid_argument(argument):
4
if not argument:
5
return "__current"
6
else:
7
return f"sched_ctx._procs[({argument})]"
8
9
def llist_foreach(head, container_type, cb):
10
c = head
11
i = 0
12
while (c["next"] != head):
13
el = c["next"].cast(container_type)
14
cb(i, el)
15
c = c["next"]
16
i+=1