From 34daa4c1cb99ed66c974336f23269cb508f71c74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Sat, 2 May 2015 13:28:56 +0200 Subject: parse_kconfig add debug output of boolexpr --- scripts/parse_kconfig/doutput.c | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) (limited to 'scripts/parse_kconfig/doutput.c') 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 */ +} -- cgit v1.2.3