Commit c6ccc30fd7870879981de03feeec61029754b0ea
Committed by
Michal Marek
1 parent
4280eae099
Exists in
master
and in
7 other branches
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: Li Zefan <lizf@cn.fujitsu.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
Showing 2 changed files with 34 additions and 8 deletions Side-by-side Diff
scripts/kconfig/zconf.tab.c_shipped
... | ... | @@ -2336,9 +2336,9 @@ |
2336 | 2336 | struct property *prop; |
2337 | 2337 | |
2338 | 2338 | if (sym_is_choice(sym)) |
2339 | - fprintf(out, "choice\n"); | |
2339 | + fprintf(out, "\nchoice\n"); | |
2340 | 2340 | else |
2341 | - fprintf(out, "config %s\n", sym->name); | |
2341 | + fprintf(out, "\nconfig %s\n", sym->name); | |
2342 | 2342 | switch (sym->type) { |
2343 | 2343 | case S_BOOLEAN: |
2344 | 2344 | fputs(" boolean\n", out); |
... | ... | @@ -2384,6 +2384,21 @@ |
2384 | 2384 | case P_CHOICE: |
2385 | 2385 | fputs(" #choice value\n", out); |
2386 | 2386 | break; |
2387 | + case P_SELECT: | |
2388 | + fputs( " select ", out); | |
2389 | + expr_fprint(prop->expr, out); | |
2390 | + fputc('\n', out); | |
2391 | + break; | |
2392 | + case P_RANGE: | |
2393 | + fputs( " range ", out); | |
2394 | + expr_fprint(prop->expr, out); | |
2395 | + fputc('\n', out); | |
2396 | + break; | |
2397 | + case P_MENU: | |
2398 | + fputs( " menu ", out); | |
2399 | + print_quoted_string(out, prop->text); | |
2400 | + fputc('\n', out); | |
2401 | + break; | |
2387 | 2402 | default: |
2388 | 2403 | fprintf(out, " unknown prop %d!\n", prop->type); |
2389 | 2404 | break; |
... | ... | @@ -2395,7 +2410,6 @@ |
2395 | 2410 | menu->help[len] = 0; |
2396 | 2411 | fprintf(out, " help\n%s\n", menu->help); |
2397 | 2412 | } |
2398 | - fputc('\n', out); | |
2399 | 2413 | } |
2400 | 2414 | |
2401 | 2415 | void zconfdump(FILE *out) |
... | ... | @@ -2428,7 +2442,6 @@ |
2428 | 2442 | expr_fprint(prop->visible.expr, out); |
2429 | 2443 | fputc('\n', out); |
2430 | 2444 | } |
2431 | - fputs("\n", out); | |
2432 | 2445 | } |
2433 | 2446 | |
2434 | 2447 | if (menu->list) |
scripts/kconfig/zconf.y
... | ... | @@ -591,9 +591,9 @@ |
591 | 591 | struct property *prop; |
592 | 592 | |
593 | 593 | if (sym_is_choice(sym)) |
594 | - fprintf(out, "choice\n"); | |
594 | + fprintf(out, "\nchoice\n"); | |
595 | 595 | else |
596 | - fprintf(out, "config %s\n", sym->name); | |
596 | + fprintf(out, "\nconfig %s\n", sym->name); | |
597 | 597 | switch (sym->type) { |
598 | 598 | case S_BOOLEAN: |
599 | 599 | fputs(" boolean\n", out); |
... | ... | @@ -639,6 +639,21 @@ |
639 | 639 | case P_CHOICE: |
640 | 640 | fputs(" #choice value\n", out); |
641 | 641 | break; |
642 | + case P_SELECT: | |
643 | + fputs( " select ", out); | |
644 | + expr_fprint(prop->expr, out); | |
645 | + fputc('\n', out); | |
646 | + break; | |
647 | + case P_RANGE: | |
648 | + fputs( " range ", out); | |
649 | + expr_fprint(prop->expr, out); | |
650 | + fputc('\n', out); | |
651 | + break; | |
652 | + case P_MENU: | |
653 | + fputs( " menu ", out); | |
654 | + print_quoted_string(out, prop->text); | |
655 | + fputc('\n', out); | |
656 | + break; | |
642 | 657 | default: |
643 | 658 | fprintf(out, " unknown prop %d!\n", prop->type); |
644 | 659 | break; |
... | ... | @@ -650,7 +665,6 @@ |
650 | 665 | menu->help[len] = 0; |
651 | 666 | fprintf(out, " help\n%s\n", menu->help); |
652 | 667 | } |
653 | - fputc('\n', out); | |
654 | 668 | } |
655 | 669 | |
656 | 670 | void zconfdump(FILE *out) |
... | ... | @@ -683,7 +697,6 @@ |
683 | 697 | expr_fprint(prop->visible.expr, out); |
684 | 698 | fputc('\n', out); |
685 | 699 | } |
686 | - fputs("\n", out); | |
687 | 700 | } |
688 | 701 | |
689 | 702 | if (menu->list) |