Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756538AbbEVF6n (ORCPT ); Fri, 22 May 2015 01:58:43 -0400 Received: from goliath.siemens.de ([192.35.17.28]:51538 "EHLO goliath.siemens.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755797AbbEVF6Y (ORCPT ); Fri, 22 May 2015 01:58:24 -0400 From: Jan Kiszka To: Andrew Morton Cc: linux-kernel@vger.kernel.org Subject: [PATCH 2/7] scripts/gdb: Also allow list_head pointer as lx-list-check paramter Date: Fri, 22 May 2015 07:58:12 +0200 Message-Id: X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1151 Lines: 33 This makes the usage more flexible. Signed-off-by: Jan Kiszka --- scripts/gdb/linux/lists.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/gdb/linux/lists.py b/scripts/gdb/linux/lists.py index 2a94b54..71fba6a 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: -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/