diff options
author | Karel Kočí <cynerd@email.cz> | 2015-05-02 13:28:56 +0200 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2015-05-02 13:28:56 +0200 |
commit | 34daa4c1cb99ed66c974336f23269cb508f71c74 (patch) | |
tree | 86801be2c70345e495b3dd16691bfff65f7f63cb /scripts/parse_kconfig/doutput.c | |
parent | 0124ff6822df8e626dec1240dc77a0a64da5a725 (diff) | |
download | linux-conf-perf-34daa4c1cb99ed66c974336f23269cb508f71c74.tar.gz linux-conf-perf-34daa4c1cb99ed66c974336f23269cb508f71c74.tar.bz2 linux-conf-perf-34daa4c1cb99ed66c974336f23269cb508f71c74.zip |
parse_kconfig add debug output of boolexpr
Diffstat (limited to 'scripts/parse_kconfig/doutput.c')
-rw-r--r-- | scripts/parse_kconfig/doutput.c | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/scripts/parse_kconfig/doutput.c b/scripts/parse_kconfig/doutput.c index ac7927f..5b94842 100644 --- a/scripts/parse_kconfig/doutput.c +++ b/scripts/parse_kconfig/doutput.c @@ -2,7 +2,7 @@ void doutput_expr(struct expr *expr) { #ifdef DEBUG - if (verbose_level < 3) + if (verbose_level <= 3) return; switch (expr->type) { case E_OR: @@ -62,3 +62,39 @@ void doutput_expr(struct expr *expr) { } #endif /* DEBUG */ } + +void doutput_boolexpr(struct boolexpr *bl, struct symlist *sl) { +#ifdef DEBUG + if (verbose_level <= 3) + return; + switch (bl->type) { + case BT_TRUE: + printf(" true\n"); + break; + case BT_FALSE: + printf(" false\n"); + break; + case BT_SYM: + printf(" CONFIG_%s\n", sl->array[bl->id - 1].name); + break; + case BT_OR: + printf(" OR\n"); + doutput_boolexpr(bl->left, sl); + doutput_boolexpr(bl->right, sl); + break; + case BT_AND: + printf(" AND\n"); + doutput_boolexpr(bl->left, sl); + doutput_boolexpr(bl->right, sl); + break; + case BT_NOT: + if (bl->left->type == BT_SYM) { + printf(" NOT CONFIG_%s\n", sl->array[bl->left->id - 1].name); + } else { + printf(" NOT\n"); + doutput_boolexpr(bl->left, sl); + } + break; + } +#endif /* DEBUG */ +} |