title: gdb python : How to iterate through a kernel linked list inside a structure
body: <p>using gdb-python script, i am trying to print data structure which includes kernel data structures and lists(e.g. struct list_head),
  the structure is</p>
  
  <pre><code>struct my_struct {
    struct my_hardware_context ahw;
    struct net_device *netdev;
    struct pci_dev *pdev;
    struct list_head mac_list;
    struct list_head wait_list;
    ....
    ....
  };
  </code></pre>
  
  <p>So while iterating this struct my_struct, how to identify there is a linked list inside this structure as There is no any TYPE_CODE_ constant for Linked list in gdb manual and if identified, after identification how to print the dereferenced struct while iterating the list.
  i am using code of scottt in this link <a href="https://stackoverflow.com/questions/16787289/gdb-python-parsing-structures-each-field-and-print-them-with-proper-value-if">gdb-python : Parsing structure&#39;s each field and print them with proper value, if exists</a> </p>