aboutsummaryrefslogtreecommitdiff
path: root/scripts/parse_kconfig
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2015-05-02 13:28:56 +0200
committerKarel Kočí <cynerd@email.cz>2015-05-02 13:28:56 +0200
commit34daa4c1cb99ed66c974336f23269cb508f71c74 (patch)
tree86801be2c70345e495b3dd16691bfff65f7f63cb /scripts/parse_kconfig
parent0124ff6822df8e626dec1240dc77a0a64da5a725 (diff)
downloadlinux-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')
-rw-r--r--scripts/parse_kconfig/doutput.c38
-rw-r--r--scripts/parse_kconfig/doutput.h2
-rw-r--r--scripts/parse_kconfig/parse.c2
3 files changed, 41 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 */
+}
diff --git a/scripts/parse_kconfig/doutput.h b/scripts/parse_kconfig/doutput.h
index f82fd9b..0d1a5fb 100644
--- a/scripts/parse_kconfig/doutput.h
+++ b/scripts/parse_kconfig/doutput.h
@@ -7,7 +7,9 @@
#include <kconfig/lkc.h>
#include <macros.h>
+#include "boolexpr.h"
void doutput_expr(struct expr *expr);
+void doutput_boolexpr(struct boolexpr *bl, struct symlist *sl);
#endif /* _DOUTPUT_H_ */
diff --git a/scripts/parse_kconfig/parse.c b/scripts/parse_kconfig/parse.c
index 7de4f2b..54941dc 100644
--- a/scripts/parse_kconfig/parse.c
+++ b/scripts/parse_kconfig/parse.c
@@ -163,6 +163,8 @@ void cpy_dep() {
pw = boolexpr_and(pw, w3);
pw = boolexpr_and(pw, w4);
}
+ Dprintf(" CNF:\n");
+ doutput_boolexpr(pw, gsymlist);
cnf_boolexpr(gsymlist, pw);
switch (pw->type) {
case BT_TRUE: