码迷,mamicode.com
首页 > 数据库 > 详细

Kconfig SourceCode GDB调试 *****

时间:2017-09-28 20:40:07      阅读:290      评论:0      收藏:0      [点我收藏+]

标签:scripts   存在   UI   conf   ++   text   too   custom   tree   

1、GDB&makefile

  scripts->Makefile编译FLAGS  -g

HOSTCC      = gcc
HOSTCXX      = g++
HOSTCFLAGS    :=
HOSTCXXFLAGS    :=
include $(srctree)/scripts/Kbuild.include

HOSTCFLAGS    += $(call hostcc-option,-Wall -Wstrict-prototypes -O2 -g -fomit-frame-pointer,)
HOSTCXXFLAGS    += -O2

 静态模式:

  所有xxxconfig的目标都执行

    %config: scripts_basic outputmakefile FORCE customer
customer:
    ../code/tools/gen_radisson_customer.pl -C ../CUS_FILE
    

config: scripts_basic outputmakefile FORCE customer
#    $(Q)mkdir -p include
    $(Q)$(MAKE) $(build)=scripts/kconfig $@
    $(Q)$(MAKE) -C $(srctree) KBUILD_SRC= .kernelrelease

%config: scripts_basic outputmakefile FORCE customer
#    $(Q)mkdir -p include
    $(Q)$(MAKE) $(build)=scripts/kconfig $@
    $(Q)$(MAKE) -C $(srctree) KBUILD_SRC= .kernelrelease

源代码

  整个UI的节点保存在“rootmenu”为“head”节点的链表中,即“rootmenu”为跟节点,“rootmenu”没有兄弟节点及父节点。

struct menu {
    struct menu *next;            //兄弟节点
    struct menu *parent;        //父节点
    struct menu *list;            //子节点链表,即下一级菜单的链表
    struct symbol *sym;            //节点符号
    struct property *prompt;    //节点提示符
    struct expr *dep;            //依赖
    unsigned int flags;
    //char *help;
    struct file *file;
    int lineno;
    void *data;
};

  如下图的UI:

  技术分享 技术分享

 

 节点图:

  技术分享

(gdb) p rootmenu
$25 = {next = 0x0, parent = 0x0, list = 0x806bfe0, sym = 0x0, prompt = 0x8063d00, dep = 0x0, flags = 0, file = 0x0, lineno = 0, data = 0x0}
(gdb) p
*rootmenu.list $27 = {next = 0x8067e70, parent = 0x8062a80 <rootmenu>, list = 0x806c0f8, sym = 0x806bfa0, prompt = 0x806c058, dep = 0x0, flags = 1, file = 0x8067d98, lineno = 3, data = 0x0}
(gdb) p
*rootmenu.list->prompt $29 = {next = 0x0, sym = 0x806bfa0, type = P_PROMPT, text = 0x806c040 "BUILD_RECORD", visible = {expr = 0x0, tri = yes}, expr = 0x0, menu = 0x806bfe0, file = 0x8067d98, lineno = 4}
(gdb) p
*rootmenu.list->next->prompt $30 = {next = 0x0, sym = 0x8067e30, type = P_PROMPT, text = 0x8067ed0 "AQ", visible = {expr = 0x0, tri = yes}, expr = 0x0, menu = 0x8067e70, file = 0x8067df8, lineno = 4}
(gdb) p
*rootmenu.list->next->next->prompt $31 = {next = 0x0, sym = 0x0, type = P_MENU, text = 0x8067ff0 "System Application", visible = {expr = 0x0, tri = no}, expr = 0x0, menu = 0x8068018, file = 0x8067fa8, lineno = 1}
(gdb) p
*rootmenu.list->next->next->list->prompt $32 = {next = 0x0, sym = 0x8068078, type = P_PROMPT, text = 0x8068828 "System APP", visible = {expr = 0x0, tri = yes}, expr = 0x0, menu = 0x80687c8, file = 0x8067fa8, lineno = 4}
(gdb) p
*rootmenu.list->next->next->list->next $33 = {next = 0x8068dd0, parent = 0x8068018, list = 0x0, sym = 0x8068ce8, prompt = 0x0, dep = 0x8068d58, flags = 1, file = 0x8067fa8, lineno = 17, data = 0x0}
(gdb) p
*rootmenu.list->next->next->list->next->next->prompt $35 = {next = 0x0, sym = 0x0, type = P_MENU, text = 0x8068da8 "Product Location Select", visible = {expr = 0x0, tri = no}, expr = 0x0, menu = 0x8068dd0, file = 0x8067fa8, lineno = 22}

 

Kconfig SourceCode GDB调试 *****

标签:scripts   存在   UI   conf   ++   text   too   custom   tree   

原文地址:http://www.cnblogs.com/jiangzhaowei/p/7608224.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!