scripts/gdb: also allow list_head pointer as lx-list-check paramter

This makes the usage more flexible.

Signed-off-by: Jan Kiszka <[email protected]>
Cc: Thiébaud Weksteen <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
Jan Kiszka authored and Linus Torvalds committed 2015-06-30 19:44:58 -07:00
1 parent 084f6b1ec6
commit 433296b32b
1 file changed
+4 -2
+4 -2
View File
@@ -20,9 +20,11 @@ list_head = utils.CachedType("struct list_head")
def list_check(head):
nb = 0
if (head.type == list_head.get_type().pointer()):
head = head.dereference()
elif (head.type != list_head.get_type()):
raise gdb.GdbError('argument must be of type (struct list_head [*])')
c = head
if (c.type != list_head.get_type()):
raise gdb.GdbError('The argument should be of type (struct list_head)')
try:
gdb.write("Starting with: {}\n".format(c))
except gdb.MemoryError: