diff options
author | Jan Kiszka <jan.kiszka@siemens.com> | 2015-06-05 15:03:49 +1000 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2015-06-05 15:03:49 +1000 |
commit | e2eae063f7e9661c858a2e33e795142aa892c77c (patch) | |
tree | 4c7c0f1d5f72d2510d04b56988888b80d3dbe4d7 | |
parent | da1f3afae73cfe91980a7cc1ebdaa70b7d536fa5 (diff) | |
download | linux-next-e2eae063f7e9661c858a2e33e795142aa892c77c.tar.gz |
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>
-rw-r--r-- | scripts/gdb/linux/lists.py | 6 |
1 files changed, 4 insertions, 2 deletions
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: |