diff --git a/scripts/gdb/linux/lists.py b/scripts/gdb/linux/lists.py index 55356b66f8ea..c487ddf09d38 100644 --- a/scripts/gdb/linux/lists.py +++ b/scripts/gdb/linux/lists.py @@ -24,7 +24,7 @@ def list_for_each(head): 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() @@ -35,9 +35,6 @@ def list_for_each(head): 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) @@ -45,7 +42,7 @@ def hlist_for_each(head): 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() @@ -56,9 +53,6 @@ def hlist_for_each(head): 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)