if head.type == list_head.get_type().pointer():
head = head.dereference()
elif head.type != list_head.get_type():
- raise gdb.GdbError("Must be struct list_head not {}"
+ raise TypeError("Must be struct list_head not {}"
.format(head.type))
node = head['next'].dereference()
def list_for_each_entry(head, gdbtype, member):
for node in list_for_each(head):
- if node.type != list_head.get_type().pointer():
- raise TypeError("Type {} found. Expected struct list_head *."
- .format(node.type))
yield utils.container_of(node, gdbtype, member)
if head.type == hlist_head.get_type().pointer():
head = head.dereference()
elif head.type != hlist_head.get_type():
- raise gdb.GdbError("Must be struct hlist_head not {}"
+ raise TypeError("Must be struct hlist_head not {}"
.format(head.type))
node = head['first'].dereference()
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 *."
- .format(node.type))
yield utils.container_of(node, gdbtype, member)