commit 50608f63409c1967f7d9e4db289bc3a0a1f619c2
Author: Stephen Kelly <steveire@gmail.com>
Date:   Wed May 18 23:41:23 2016 +0200

    Hack the cindex-dump for demo purpose

diff --git a/bindings/python/examples/cindex/cindex-dump.py b/bindings/python/examples/cindex/cindex-dump.py
index 5556ad1..02c67a4 100644
--- a/bindings/python/examples/cindex/cindex-dump.py
+++ b/bindings/python/examples/cindex/cindex-dump.py
@@ -36,12 +36,12 @@ def get_cursor_id(cursor, cursor_list = []):
     cursor_list.append(cursor)
     return len(cursor_list) - 1
 
-def get_info(node, depth=0):
+def get_info(node, tu, depth=0):
     if opts.maxDepth is not None and depth >= opts.maxDepth:
         children = None
     else:
-        children = [get_info(c, depth+1)
-                    for c in node.get_children()]
+        children = [get_info(c, tu, depth+1)
+                    for c in node.get_children() if c.location.file.name == tu.spelling]
     return { 'id' : get_cursor_id(node),
              'kind' : node.kind,
              'usr' : node.get_usr(),
@@ -55,6 +55,10 @@ def get_info(node, depth=0):
 
 def main():
     from clang.cindex import Index
+
+    from clang import cindex
+    cindex.Config.set_library_file("/usr/lib/x86_64-linux-gnu/libclang.so.1")
+
     from pprint import pprint
 
     from optparse import OptionParser, OptionGroup
@@ -75,12 +79,13 @@ def main():
         parser.error('invalid number arguments')
 
     index = Index.create()
-    tu = index.parse(None, args)
+    print args
+    tu = index.parse(None, ["-x", "c++", "-std=c++11", "-I/usr/include/c++/5", "-I/usr/include/x86_64-linux-gnu/c++/5", "-I/usr/lib/gcc/x86_64-linux-gnu/5/include"] + args)
     if not tu:
         parser.error("unable to load input")
 
     pprint(('diags', map(get_diag_info, tu.diagnostics)))
-    pprint(('nodes', get_info(tu.cursor)))
+    pprint(('nodes', get_info(tu.cursor, tu)))
 
 if __name__ == '__main__':
     main()

