From Stack Overflow. Get gcc or clang to output a hierarchical list of included headers like this: clang -H ...