MCPcopy Create free account
hub / github.com/coreboot/coreboot / get_symbol_str

Function get_symbol_str

util/kconfig/menu.c:776–825  ·  view source on GitHub ↗

* head is optional and may be NULL */

Source from the content-addressed store, hash-verified

774 * head is optional and may be NULL
775 */
776static void get_symbol_str(struct gstr *r, struct symbol *sym,
777 struct list_head *head)
778{
779 struct property *prop;
780
781 if (sym && sym->name) {
782 str_printf(r, "Symbol: %s [=%s]\n", sym->name,
783 sym_get_string_value(sym));
784 str_printf(r, "Type : %s\n", sym_type_name(sym->type));
785 if (sym->type == S_INT || sym->type == S_HEX) {
786 prop = sym_get_range_prop(sym);
787 if (prop) {
788 str_printf(r, "Range : ");
789 expr_gstr_print(prop->expr, r);
790 str_append(r, "\n");
791 }
792 }
793 }
794
795 /* Print the definitions with prompts before the ones without */
796 for_all_properties(sym, prop, P_SYMBOL) {
797 if (prop->menu->prompt) {
798 get_def_str(r, prop->menu);
799 get_prompt_str(r, prop->menu->prompt, head);
800 }
801 }
802
803 for_all_properties(sym, prop, P_SYMBOL) {
804 if (!prop->menu->prompt) {
805 get_def_str(r, prop->menu);
806 get_dep_str(r, prop->menu->dep, " Depends on: ");
807 }
808 }
809
810 get_symbol_props_str(r, sym, P_SELECT, "Selects: ");
811 if (sym->rev_dep.expr) {
812 expr_gstr_print_revdep(sym->rev_dep.expr, r, yes, "Selected by [y]:\n");
813 expr_gstr_print_revdep(sym->rev_dep.expr, r, mod, "Selected by [m]:\n");
814 expr_gstr_print_revdep(sym->rev_dep.expr, r, no, "Selected by [n]:\n");
815 }
816
817 get_symbol_props_str(r, sym, P_IMPLY, "Implies: ");
818 if (sym->implied.expr) {
819 expr_gstr_print_revdep(sym->implied.expr, r, yes, "Implied by [y]:\n");
820 expr_gstr_print_revdep(sym->implied.expr, r, mod, "Implied by [m]:\n");
821 expr_gstr_print_revdep(sym->implied.expr, r, no, "Implied by [n]:\n");
822 }
823
824 str_append(r, "\n\n");
825}
826
827struct gstr get_relations_str(struct symbol **sym_arr, struct list_head *head)
828{

Callers 2

get_relations_strFunction · 0.85
menu_get_ext_helpFunction · 0.85

Calls 11

str_printfFunction · 0.85
sym_get_string_valueFunction · 0.85
sym_type_nameFunction · 0.85
sym_get_range_propFunction · 0.85
expr_gstr_printFunction · 0.85
str_appendFunction · 0.85
get_def_strFunction · 0.85
get_prompt_strFunction · 0.85
get_dep_strFunction · 0.85
get_symbol_props_strFunction · 0.85
expr_gstr_print_revdepFunction · 0.85

Tested by

no test coverage detected