Skip to content

Commit 433296b

Browse files
jan-kiszkatorvalds
authored andcommitted
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>
1 parent 084f6b1 commit 433296b

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎scripts/gdb/linux/lists.py‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@
2020

2121
def list_check(head):
2222
nb = 0
23+
if (head.type == list_head.get_type().pointer()):
24+
head = head.dereference()
25+
elif (head.type != list_head.get_type()):
26+
raise gdb.GdbError('argument must be of type (struct list_head [*])')
2327
c = head
24-
if (c.type != list_head.get_type()):
25-
raise gdb.GdbError('The argument should be of type (struct list_head)')
2628
try:
2729
gdb.write("Starting with: {}\n".format(c))
2830
except gdb.MemoryError:

0 commit comments

Comments
 (0)