Displaying data structures



Creating a graphical view

QLcrash offers serveral ways to display data structures. E.g. to inspect a certain task struct the easiest method is a double click on the corresponding task list entry in the task window.
To display another data structure or a task_struct for a process not listed in the task list it is possible to specify a data type with an address either at the console or the print dialog. If a user wants to display a task_struct at address 0x7c34000 for example, she could type

graph print *(task_struct*) 0x7c34000


at the console. Or with the print dialog (press F3):

Figure 1

In case the print command fails, there are two common reasons:

  1. A syntax error (wrong number of parenthesis, missing asterics)
  2. The data type is unknown

Datatypes can be added using the addtypes command at the console. Refer to the lcrash documentation or the help command for further information.

Working with structures

Once a data structure is displayed, pointers can be dereferenced with a double click. This opens another list as shown in figure 2. The list view provides a context menu for each elment. Depending on the type of the selected element, the following options are available:

Type info

Prints the data type and size of the current element to the main console.

whatis

Prints the type declaration to the main console.

print...

Sometimes an address is stored as an unsigned int or some other data type. Or the user wants to display another data structure at this address. This command opens a dialog window where the user may type in the desired data type as she would do with the graph print dialog window.

walk

This command is available if the current element is a pointer of the same type as the displayed structure. In this case the current structure is treated as an element of a linked list. `walk' traverses this list and creates an array of pointers until a null pointer or a loop is detected. Afterwards the pointer array is displayed as a new object.

Print array

If the selected item is a pointer it might be the address of a dynamic array. With this command the user is prompted to enter a number of elements for this array. QLcrash then creates a new object with an array of pointers.

dump

Opens a dump window and displays a memory dump if the selected item is a pointer.

Figure 2