X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/9eed27f6f2f002145667fb4abfc5e476b53630e5..7b8a1bcad75628f9add4590db2bb9b8e418ee8eb:/lunaix-os/scripts/gdb/lunadbg/utils.py diff --git a/lunaix-os/scripts/gdb/lunadbg/utils.py b/lunaix-os/scripts/gdb/lunadbg/utils.py index b48adee..43d947a 100644 --- a/lunaix-os/scripts/gdb/lunadbg/utils.py +++ b/lunaix-os/scripts/gdb/lunadbg/utils.py @@ -1,6 +1,16 @@ +import gdb def pid_argument(argument): if not argument: return "__current" else: - return f"sched_ctx._procs[({argument})]" \ No newline at end of file + return f"sched_ctx._procs[({argument})]" + +def llist_foreach(head, container_type, cb): + c = head + i = 0 + while (c["next"] != head): + el = c["next"].cast(container_type) + cb(i, el) + c = c["next"] + i+=1 \ No newline at end of file