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
515515 struct jump_key *jump;
516516
517517 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− }
525518 menu = prop->menu->parent;
526519 for (i = 0; menu != &rootmenu && i < 8; menu = menu->parent) {
527520 bool accessible = menu_is_visible(menu);
@@ -571,6 +564,18 @@ static void get_prompt_str(struct gstr *r, struct property *prop, · 43 unmodified lines
571564 }
572565 }
573566
567+/*
568+ * get peoperty of type P_SYMBOL
569+ */
570+static 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+
574579 /*
575580 * head is optional and may be NULL
576581 */
@@ -595,6 +600,14 @@ void get_symbol_str(struct gstr *r, struct symbol *sym, · 18 unmodified lines
595600 }
596601 for_all_prompts(sym, prop)
597602 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+ }
598611 hit = false;
599612 for_all_properties(sym, prop, P_SELECT) {
600613 if (!hit) {