Эх сурвалжийг харах

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

This makes the usage more flexible.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Cc: Thiébaud Weksteen <thiebaud@weksteen.fr>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Jan Kiszka 10 жил өмнө
parent
commit
433296b32b

+ 4 - 2
scripts/gdb/linux/lists.py

@@ -20,9 +20,11 @@ list_head = utils.CachedType("struct list_head")
 
 
 def list_check(head):
 def list_check(head):
     nb = 0
     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
     c = head
-    if (c.type != list_head.get_type()):
-        raise gdb.GdbError('The argument should be of type (struct list_head)')
     try:
     try:
         gdb.write("Starting with: {}\n".format(c))
         gdb.write("Starting with: {}\n".format(c))
     except gdb.MemoryError:
     except gdb.MemoryError: