From 433296b32b39bd2f8a8717ccb2385b4c8654017d Mon Sep 17 00:00:00 2001 From: Jan Kiszka Date: Tue, 30 Jun 2015 14:58:10 -0700 Subject: scripts/gdb: also allow list_head pointer as lx-list-check paramter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This makes the usage more flexible. Signed-off-by: Jan Kiszka Cc: ThiƩbaud Weksteen Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- scripts/gdb/linux/lists.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'scripts/gdb') diff --git a/scripts/gdb/linux/lists.py b/scripts/gdb/linux/lists.py index 2a94b5462d063..71fba6afcb558 100644 --- a/scripts/gdb/linux/lists.py +++ b/scripts/gdb/linux/lists.py @@ -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: -- cgit v1.2.3