[lkml]   [2019]   [Apr]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH 1/3] scripts/gdb: Add hlist utilities
On 4/22/2019 11:41 PM, Stephen Boyd wrote:
> Quoting Leonard Crestez (2019-04-22 01:26:56)
>> This allows easily examining kernel hlists in python.
>> Signed-off-by: Leonard Crestez <>
>> +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 *.

Makes sense, it was copy/pasted from list_for_each_entry. Since this
iterates over items from hlist_for_each the check is only useful as an
assertion anyway so I'll just drop it.

The hlist_for_each/list_for_each raise gdb.GdbError on type mismatch; as
far as I understand the difference is that GdbError won't print a python
backtrace. However these are internal helpers so TypeError makes more sense.

 \ /
  Last update: 2019-04-23 11:21    [W:0.042 / U:4.848 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site