Re: [PATCH 1/3] scripts/gdb: Add hlist utilities
From: Stephen Boyd
Date: Mon Apr 22 2019 - 16:41:25 EST
Quoting Leonard Crestez (2019-04-22 01:26:56)
> This allows easily examining kernel hlists in python.
>
> Signed-off-by: Leonard Crestez <leonard.crestez@xxxxxxx>
Reviewed-by: Stephen Boyd <sboyd@xxxxxxxxxx>
> +
> +
> +def hlist_for_each_entry(head, gdbtype, member):
> + for node in hlist_for_each(head):
> + if node.type != hlist_node.get_type().pointer():
> + raise TypeError("Type {} found. Expected struct hlist_head *."
Maybe drop the full-stop? It looks weird to see struct list_head *.
> + .format(node.type))
> + yield utils.container_of(node, gdbtype, member)
> +
> +