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

Makefile的执行过程:

../code/tools/gen_radisson_customer.pl -C ../CUS_FILE

make -f scripts/Makefile.build obj=scripts/kconfig menuconfig
set -e; echo ' HOSTCC scripts/kconfig/conf.o';
gcc -Wp,-MD,scripts/kconfig/.conf.o.d -Wall -Wstrict-prototypes -O2 -g -fomit-frame-pointer \
   -c -o scripts/kconfig/conf.o scripts/kconfig/conf.c; scripts/basic/fixdep scripts/kconfig/.conf.o.d scripts/kconfig/conf.o \
  'gcc -Wp,-MD,scripts/kconfig/.conf.o.d -Wall -Wstrict-prototypes -O2 -g -fomit-frame-pointer -c -o scripts/kconfig/conf.o scripts/kconfig/conf.c' \
  > scripts/kconfig/.conf.o.tmp; rm -f scripts/kconfig/.conf.o.d; mv -f scripts/kconfig/.conf.o.tmp scripts/kconfig/.conf.o.cmd
set -e; echo ' HOSTCC scripts/kconfig/kxgettext.o';
gcc -Wp,-MD,scripts/kconfig/.kxgettext.o.d -Wall -Wstrict-prototypes -O2 -g -fomit-frame-pointer -c -o scripts/kconfig/kxgettext.o scripts/kconfig/kxgettext.c; scripts/basic/fixdep scripts/kconfig/.kxgettext.o.d scripts/kconfig/kxgettext.o
'gcc -Wp,-MD,scripts/kconfig/.kxgettext.o.d -Wall -Wstrict-prototypes -O2 -g -fomit-frame-pointer -c -o scripts/kconfig/kxgettext.o scripts/kconfig/kxgettext.c' > scripts/kconfig/.kxgettext.o.tmp;
rm -f scripts/kconfig/.kxgettext.o.d;
mv -f scripts/kconfig/.kxgettext.o.tmp scripts/kconfig/.kxgettext.o.cmd
set -e; echo ' HOSTCC scripts/kconfig/mconf.o';
gcc -Wp,-MD,scripts/kconfig/.mconf.o.d -Wall -Wstrict-prototypes -O2 -g -fomit-frame-pointer -c -o scripts/kconfig/mconf.o scripts/kconfig/mconf.c; scripts/basic/fixdep scripts/kconfig/.mconf.o.d scripts/kconfig/mconf.o
'gcc -Wp,-MD,scripts/kconfig/.mconf.o.d -Wall -Wstrict-prototypes -O2 -g -fomit-frame-pointer -c -o scripts/kconfig/mconf.o scripts/kconfig/mconf.c' > scripts/kconfig/.mconf.o.tmp; rm -f scripts/kconfig/.mconf.o.d;
mv -f scripts/kconfig/.mconf.o.tmp scripts/kconfig/.mconf.o.cmd
set -e; echo ' HOSTCC scripts/kconfig/zconf.tab.o';
gcc -Wp,-MD,scripts/kconfig/.zconf.tab.o.d -Wall -Wstrict-prototypes -O2 -g -fomit-frame-pointer -Iscripts/kconfig -c -o scripts/kconfig/zconf.tab.o scripts/kconfig/zconf.tab.c; scripts/basic/fixdep scripts/kconfig/.zconf.tab.o.d scripts/kconfig/zconf.tab.o
'gcc -Wp,-MD,scripts/kconfig/.zconf.tab.o.d -Wall -Wstrict-prototypes -O2 -g -fomit-frame-pointer -Iscripts/kconfig -c -o scripts/kconfig/zconf.tab.o scripts/kconfig/zconf.tab.c' > scripts/kconfig/.zconf.tab.o.tmp;
rm -f scripts/kconfig/.zconf.tab.o.d;
mv -f scripts/kconfig/.zconf.tab.o.tmp scripts/kconfig/.zconf.tab.o.cmd
set -e; echo ' HOSTLD scripts/kconfig/mconf';
gcc -o scripts/kconfig/mconf scripts/kconfig/mconf.o scripts/kconfig/zconf.tab.o ; echo 'cmd_scripts/kconfig/mconf := gcc -o scripts/kconfig/mconf scripts/kconfig/mconf.o scripts/kconfig/zconf.tab.o ' > scripts/kconfig/.mconf.cmd

make -f scripts/Makefile.build obj=scripts/kconfig/lxdialog set -e; echo ' HOSTLD scripts/kconfig/lxdialog/lxdialog';
gcc -o scripts/kconfig/lxdialog/lxdialog scripts/kconfig/lxdialog/checklist.o scripts/kconfig/lxdialog/menubox.o scripts/kconfig/lxdialog/textbox.o scripts/kconfig/lxdialog/yesno.o scripts/kconfig/lxdialog/inputbox.o scripts/kconfig/lxdialog/util.o scripts/kconfig/lxdialog/lxdialog.o scripts/kconfig/lxdialog/msgbox.o -lncursesw ; echo 'cmd_scripts/kconfig/lxdialog/lxdialog := gcc -o scripts/kconfig/lxdialog/lxdialog scripts/kconfig/lxdialog/checklist.o scripts/kconfig/lxdialog/menubox.o scripts/kconfig/lxdialog/textbox.o scripts/kconfig/lxdialog/yesno.o scripts/kconfig/lxdialog/inputbox.o scripts/kconfig/lxdialog/util.o scripts/kconfig/lxdialog/lxdialog.o scripts/kconfig/lxdialog/msgbox.o -lncursesw ' > scripts/kconfig/lxdialog/.lxdialog.cmd
/bin/sh /home/kk/share/bak/512c/scripts_0925/scripts/kconfig/lxdialog/check-lxdialog.sh -check gcc -DCURSES_LOC="<ncurses.h>" -DLOCALE -lncursesw
:
gdb scripts/kconfig/mconf Config.in
make -C /home/kk/share/bak/512c/scripts_0925 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
$ = {next = 0x0, parent = 0x0, list = 0x806bfe0, sym = 0x0, prompt = 0x8063d00, dep = 0x0, flags = , file = 0x0, lineno = , data = 0x0}
(gdb) p *rootmenu.list
$ = {next = 0x8067e70, parent = 0x8062a80 <rootmenu>, list = 0x806c0f8, sym = 0x806bfa0, prompt = 0x806c058, dep = 0x0, flags = ,
file = 0x8067d98, lineno = , data = 0x0}
(gdb) p *rootmenu.list->prompt
$ = {next = 0x0, sym = 0x806bfa0, type = P_PROMPT, text = 0x806c040 "BUILD_RECORD", visible = {expr = 0x0, tri = yes}, expr = 0x0,
menu = 0x806bfe0, file = 0x8067d98, lineno = }
(gdb) p *rootmenu.list->next->prompt
$ = {next = 0x0, sym = 0x8067e30, type = P_PROMPT, text = 0x8067ed0 "AQ", visible = {expr = 0x0, tri = yes}, expr = 0x0, menu = 0x8067e70,
file = 0x8067df8, lineno = }
(gdb) p *rootmenu.list->next->next->prompt
$ = {next = 0x0, sym = 0x0, type = P_MENU, text = 0x8067ff0 "System Application", visible = {expr = 0x0, tri = no}, expr = 0x0, menu = 0x8068018,
file = 0x8067fa8, lineno = }
(gdb) p *rootmenu.list->next->next->list->prompt
$ = {next = 0x0, sym = 0x8068078, type = P_PROMPT, text = 0x8068828 "System APP", visible = {expr = 0x0, tri = yes}, expr = 0x0, menu = 0x80687c8,
file = 0x8067fa8, lineno = }
(gdb) p *rootmenu.list->next->next->list->next
$ = {next = 0x8068dd0, parent = 0x8068018, list = 0x0, sym = 0x8068ce8, prompt = 0x0, dep = 0x8068d58, flags = , file = 0x8067fa8, lineno = ,
data = 0x0}
(gdb) p *rootmenu.list->next->next->list->next->next->prompt
$ = {next = 0x0, sym = 0x0, type = P_MENU, text = 0x8068da8 "Product Location Select", visible = {expr = 0x0, tri = no}, expr = 0x0,
menu = 0x8068dd0, file = 0x8067fa8, lineno = }

Kconfig SourceCode GDB调试 *****的更多相关文章

  1. 在qemu环境中用gdb调试Linux内核

    简介 对用户态进程,利用gdb调试代码是很方便的手段.而对于内核态的问题,可以利用crash等工具基于coredump文件进行调试.其实我们也可以利用一些手段对Linux内核代码进行gdb调试,qem ...

  2. GDB调试命令小结

    1.启动调试 前置条件:编译生成执行码时带上 -g,如果使用Makefile,通过给CFLAGS指定-g选项,否则调试时没有符号信息.gdb program //最常用的用gdb启动程序,开始调试的方 ...

  3. GDB调试汇编堆栈过程分析

    GDB调试汇编堆栈过程分析 分析过程 这是我的C源文件:click here 使用gcc - g example.c -o example -m32指令在64位的机器上产生32位汇编,然后使用gdb ...

  4. gdb调试器的使用

    想要使用gdb调试程序的话,首先需要gcc -g main.c -o test 然后运行gdb test对程序进行调试 l (小写的l,是list的首字母),用以列出程序 回车    是运行上一个命令 ...

  5. 20145212——GDB调试汇编堆栈过程分析

    GDB调试汇编堆栈过程分析 测试代码 #include <stdio.h> short val = 1; int vv = 2; int g(int xxx) { return xxx + ...

  6. gdb调试PHP扩展错误

    有时候,使用PHP的第三方扩展之后,可能会发生一些错误,这个时候,可能就需要更底层的方式追踪调试程序发生错误的地方和原因,熟悉linux下C编程的肯定不陌生gdb 首先,使用ulimit -c命令,查 ...

  7. gdb调试汇编堆栈过程的学习

    gdb调试汇编堆栈过程的学习 以下为C源文件 使用gcc - g code.c -o code -m32指令在64位的机器上产生32位汇编,然后使用gdb example指令进入gdb调试器: 进入之 ...

  8. gdb调试

    ·代码(实验楼中的代码,改了部分数值)命名为test.c int g(int x) { return x + 7; } int f(int x) { return g(x); } int main(v ...

  9. 20145223《信息安全系统设计基础》 GDB调试汇编堆栈过程分析

    20145223<信息安全系统设计基础> GDB调试汇编堆栈过程分析 分析的c语言源码 生成汇编代码--命令:gcc -g example.c -o example -m32 进入gdb调 ...

随机推荐

  1. 字符串str.format()方法的个人整理

    引言: 字符串的内置方法大致有40来个,但是一些常用的其实就那么20几个,而且里面还有类似的用法,区分度高比如isalpha,isalnum,isdigit,还有一些无时不刻都会用到的split切分, ...

  2. 大数据平台消息流系统Kafka

    Kafka前世今生 随着大数据时代的到来,数据中蕴含的价值日益得到展现,仿佛一座待人挖掘的金矿,引来无数的掘金者.但随着数据量越来越大,如何实时准确地收集并分析如此大的数据成为摆在所有从业人员面前的难 ...

  3. Wireshark抓包工具的简单使用1(界面介绍)

    Wireshark安装完成后,就可以打开,具体运行界面如下 一.菜单——用于开始操作 File ——包括打开.合并捕捉文件,save/保存,Print/打印,Export/导出捕捉文件的全部或部分.以 ...

  4. webdriver学习笔记(一):webdrive脚本打开firefox浏览器,报“AttributeError: module 'selenium.webdriver' has no attribu

    按照网上提供的方法: 下载geckodriver之后解压缩到 Firefox安装目录 下 添加 Firefox安装目录 到 系统变量Path 重启pycharm 照此步骤执行后,仍然报同样的错.折腾了 ...

  5. expdp,impdp,include,exclude

    The examples below are based on:- the demo schema SCOTT that is created with script: $ORACLE_HOME/rd ...

  6. [luoguP1962] 斐波那契数列(矩阵快速幂)

    传送门 解析详见julao博客连接 http://worldframe.top/2017/05/10/清单-数学方法-——-矩阵/ ——代码 #include <cstdio> #incl ...

  7. [NOIP2007] 普及组

    奖学金 模拟 开个struct排序即可 c++吼啊 /*by SilverN*/ #include<algorithm> #include<iostream> #include ...

  8. [NOIP2006] 提高组 洛谷P1063 能量项链

    题目描述 在Mars星球上,每个Mars人都随身佩带着一串能量项链.在项链上有N颗能量珠.能量珠是一颗有头标记与尾标记的珠子,这些标记对应着某个正整数.并且,对于相邻的两颗珠子,前一颗珠子的尾标记一定 ...

  9. PatentTips – EMC Virtual File System

    BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention generally relates to net ...

  10. Codeforces Educational Round 21

    A =w= B qwq C wvw D(multiset) 题意: 有n(n<=1e5)个数,希望通过把一个位置y的数字放到位置x上这个操作,使得新序列的某个前缀和等于总和的一半,问这样的操作是 ...