summaryrefslogtreecommitdiff
path: root/examples/print_undefined.py
blob: fb8120bdbaea96d16abacf1b823e1e050ddbb66b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# Prints the names of all symbols that are referenced but never defined in the
# current configuration together with the locations where they are referenced.
# Integers being included in the list is not a bug, as these need to be treated
# as symbols per the design of Kconfig.

import kconfiglib
import sys

conf = kconfiglib.Config(sys.argv[1])

for sym in conf.get_symbols():
    if not sym.is_defined():
        print(sym.get_name())
        for (filename, linenr) in sym.get_ref_locations():
            print("  {0}:{1}".format(filename, linenr))