History

menuconfig: print more info for symbol without prompts

When we search a config symbol, if it has no prompt the position of this symbol in the Kconfig file and it's dependencies are not printed. This can be inconvenient, especially when it's set to n and we want to find out why. the following is an example: before: Symbol: GENERIC_SMP_IDLE_THREAD [=y] Type : boolean Selected by: X86 [=y] after: Symbol: GENERIC_SMP_IDLE_THREAD [=y] Type : boolean Defined at arch/Kconfig:213 Selected by: X86 [=y]

Wengmeiling committed 13 years ago

Commit bcdedcc1 parent 657a5201 file · +20 −7Browse files

Showing the changes to scripts/kconfig (1 of 1 file). Show all

Unified · Split

scripts/kconfig/menu.c+20−7
@@ -515,13 +515,6 @@ static void get_prompt_str(struct gstr *r, struct property *prop, · 514 unmodified lines
515 struct jump_key *jump;515 struct jump_key *jump;
516 516
517 str_printf(r, _("Prompt: %s\n"), _(prop->text));517 str_printf(r, _("Prompt: %s\n"), _(prop->text));
518 str_printf(r, _(" Defined at %s:%d\n"), prop->menu->file->name,
519 prop->menu->lineno);
520 if (!expr_is_yes(prop->visible.expr)) {
521 str_append(r, _(" Depends on: "));
522 expr_gstr_print(prop->visible.expr, r);
523 str_append(r, "\n");
524 }
525 menu = prop->menu->parent;518 menu = prop->menu->parent;
526 for (i = 0; menu != &rootmenu && i < 8; menu = menu->parent) {519 for (i = 0; menu != &rootmenu && i < 8; menu = menu->parent) {
527 bool accessible = menu_is_visible(menu);520 bool accessible = menu_is_visible(menu);
@@ -571,6 +564,18 @@ static void get_prompt_str(struct gstr *r, struct property *prop, · 43 unmodified lines
571 }564 }
572}565}
573 566
567/*
568 * get peoperty of type P_SYMBOL
569 */
570static struct property *get_symbol_prop(struct symbol *sym)
571{
572 struct property *prop = NULL;
573
574 for_all_properties(sym, prop, P_SYMBOL)
575 break;
576 return prop;
577}
578
574/*579/*
575 * head is optional and may be NULL580 * head is optional and may be NULL
576 */581 */
@@ -595,6 +600,14 @@ void get_symbol_str(struct gstr *r, struct symbol *sym, · 18 unmodified lines
595 }600 }
596 for_all_prompts(sym, prop)601 for_all_prompts(sym, prop)
597 get_prompt_str(r, prop, head);602 get_prompt_str(r, prop, head);
603 prop = get_symbol_prop(sym);
604 str_printf(r, _(" Defined at %s:%d\n"), prop->menu->file->name,
605 prop->menu->lineno);
606 if (!expr_is_yes(prop->visible.expr)) {
607 str_append(r, _(" Depends on: "));
608 expr_gstr_print(prop->visible.expr, r);
609 str_append(r, "\n");
610 }
598 hit = false;611 hit = false;
599 for_all_properties(sym, prop, P_SELECT) {612 for_all_properties(sym, prop, P_SELECT) {
600 if (!hit) {613 if (!hit) {