# Walk

The walk command can be used for automatically following linked lists. Both 'normal' linked lists and 'listhead' based lists can be processed. In the walk dialog first the type of the elements of the linked list has to be specified. In our example we want to walk through all task structs so we specify "task_struct". In the second field the member which contains the 'next' or 'previous' pointer to the following element of the list must be specified. In the task list example this is the member 'next_task'. The last argument which has to be specified is the address of the list element where walk should start. Here a screenshot of our example:

In the Linux kernel there exist many linked lists using the `'listhead'` structure. To walk through a listhead based linked list instead of the next member, the name of the member with type `list_head` has to be specified. E.g. if we want to walk through a linked list of `mm_structs`, where the list_head member is named 'mmlist' the following has to be specified:

The mm_struct is defined as follows in our example:

    struct mm_struct {
            struct vm_area_struct *mmap;

            ...

            struct list_head {
                    struct list_head *next;
                    struct list_head *prev;
            } mmlist;

            ...
    };

The output of qlcrash is shown in the next screenshot. It is possible to double click on any entry in order to expand the datastructure.

It is also possible to invoke walk through a context menu when clicking on the next member or listhead member of a data structure.