Commit c6ccc30f authored by Li Zefan's avatar Li Zefan Committed by Michal Marek

kconfig: fix zconfdump()

zconfdump(), which is used for debugging, can't recognize P_SELECT,
P_RANGE and P_MENU (if associated with a symbol, aka "menuconfig"),
and output something like this:

config X86
  boolean
  default y
  unknown prop 6!
  unknown prop 6!
  unknown prop 6!
  ...
Signed-off-by: default avatarLi Zefan <lizf@cn.fujitsu.com>
Signed-off-by: default avatarMichal Marek <mmarek@suse.cz>
parent 4280eae0
...@@ -2336,9 +2336,9 @@ static void print_symbol(FILE *out, struct menu *menu) ...@@ -2336,9 +2336,9 @@ static void print_symbol(FILE *out, struct menu *menu)
struct property *prop; struct property *prop;
if (sym_is_choice(sym)) if (sym_is_choice(sym))
fprintf(out, "choice\n"); fprintf(out, "\nchoice\n");
else else
fprintf(out, "config %s\n", sym->name); fprintf(out, "\nconfig %s\n", sym->name);
switch (sym->type) { switch (sym->type) {
case S_BOOLEAN: case S_BOOLEAN:
fputs(" boolean\n", out); fputs(" boolean\n", out);
...@@ -2384,6 +2384,21 @@ static void print_symbol(FILE *out, struct menu *menu) ...@@ -2384,6 +2384,21 @@ static void print_symbol(FILE *out, struct menu *menu)
case P_CHOICE: case P_CHOICE:
fputs(" #choice value\n", out); fputs(" #choice value\n", out);
break; break;
case P_SELECT:
fputs( " select ", out);
expr_fprint(prop->expr, out);
fputc('\n', out);
break;
case P_RANGE:
fputs( " range ", out);
expr_fprint(prop->expr, out);
fputc('\n', out);
break;
case P_MENU:
fputs( " menu ", out);
print_quoted_string(out, prop->text);
fputc('\n', out);
break;
default: default:
fprintf(out, " unknown prop %d!\n", prop->type); fprintf(out, " unknown prop %d!\n", prop->type);
break; break;
...@@ -2395,7 +2410,6 @@ static void print_symbol(FILE *out, struct menu *menu) ...@@ -2395,7 +2410,6 @@ static void print_symbol(FILE *out, struct menu *menu)
menu->help[len] = 0; menu->help[len] = 0;
fprintf(out, " help\n%s\n", menu->help); fprintf(out, " help\n%s\n", menu->help);
} }
fputc('\n', out);
} }
void zconfdump(FILE *out) void zconfdump(FILE *out)
...@@ -2428,7 +2442,6 @@ void zconfdump(FILE *out) ...@@ -2428,7 +2442,6 @@ void zconfdump(FILE *out)
expr_fprint(prop->visible.expr, out); expr_fprint(prop->visible.expr, out);
fputc('\n', out); fputc('\n', out);
} }
fputs("\n", out);
} }
if (menu->list) if (menu->list)
......
...@@ -591,9 +591,9 @@ static void print_symbol(FILE *out, struct menu *menu) ...@@ -591,9 +591,9 @@ static void print_symbol(FILE *out, struct menu *menu)
struct property *prop; struct property *prop;
if (sym_is_choice(sym)) if (sym_is_choice(sym))
fprintf(out, "choice\n"); fprintf(out, "\nchoice\n");
else else
fprintf(out, "config %s\n", sym->name); fprintf(out, "\nconfig %s\n", sym->name);
switch (sym->type) { switch (sym->type) {
case S_BOOLEAN: case S_BOOLEAN:
fputs(" boolean\n", out); fputs(" boolean\n", out);
...@@ -639,6 +639,21 @@ static void print_symbol(FILE *out, struct menu *menu) ...@@ -639,6 +639,21 @@ static void print_symbol(FILE *out, struct menu *menu)
case P_CHOICE: case P_CHOICE:
fputs(" #choice value\n", out); fputs(" #choice value\n", out);
break; break;
case P_SELECT:
fputs( " select ", out);
expr_fprint(prop->expr, out);
fputc('\n', out);
break;
case P_RANGE:
fputs( " range ", out);
expr_fprint(prop->expr, out);
fputc('\n', out);
break;
case P_MENU:
fputs( " menu ", out);
print_quoted_string(out, prop->text);
fputc('\n', out);
break;
default: default:
fprintf(out, " unknown prop %d!\n", prop->type); fprintf(out, " unknown prop %d!\n", prop->type);
break; break;
...@@ -650,7 +665,6 @@ static void print_symbol(FILE *out, struct menu *menu) ...@@ -650,7 +665,6 @@ static void print_symbol(FILE *out, struct menu *menu)
menu->help[len] = 0; menu->help[len] = 0;
fprintf(out, " help\n%s\n", menu->help); fprintf(out, " help\n%s\n", menu->help);
} }
fputc('\n', out);
} }
void zconfdump(FILE *out) void zconfdump(FILE *out)
...@@ -683,7 +697,6 @@ void zconfdump(FILE *out) ...@@ -683,7 +697,6 @@ void zconfdump(FILE *out)
expr_fprint(prop->visible.expr, out); expr_fprint(prop->visible.expr, out);
fputc('\n', out); fputc('\n', out);
} }
fputs("\n", out);
} }
if (menu->list) if (menu->list)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment