1、
s:进入某个函数
finish :从这个函数中出来
(gdb) b dkauth_mgr.c:132
Breakpoint 1 at 0x3423cfd4: file /home/jintao/cvf-integration/apps/cvf/services/dkauth/src/dkauth_mgr.c, line 132.
(gdb) r
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /home/jintao/NT3/nt3_image/vdc-target.elf
[Switching to Thread 57005]
Breakpoint 1, load_vehicle_info () at /home/jintao/cvf-integration/apps/cvf/services/dkauth/src/dkauth_mgr.c:132
132 /home/jintao/cvf-integration/apps/cvf/services/dkauth/src/dkauth_mgr.c: No such file or directory.
(gdb) s
convert_hexStr_to_hexArray (buff=0x344eac70 "", uBuffSize=16, pString=0x344eac80 "a63c3c60aa634b561809527290001010", strLen=32)
at /home/jintao/cvf-integration/apps/cvf/services/common-utils/src/common_utils.c:124
124 /home/jintao/cvf-integration/apps/cvf/services/common-utils/src/common_utils.c: No such file or directory.
(gdb) n
125 in /home/jintao/cvf-integration/apps/cvf/services/common-utils/src/common_utils.c
(gdb) n
126 in /home/jintao/cvf-integration/apps/cvf/services/common-utils/src/common_utils.c
(gdb) finish
Run till exit from #0 convert_hexStr_to_hexArray (buff=0x344eac70 "", uBuffSize=16, pString=0x344eac80 "a63c3c60aa634b561809527290001010", strLen=32)
at /home/jintao/cvf-integration/apps/cvf/services/common-utils/src/common_utils.c:126
0x3423cfdc in load_vehicle_info () at /home/jintao/cvf-integration/apps/cvf/services/dkauth/src/dkauth_mgr.c:132
132 /home/jintao/cvf-integration/apps/cvf/services/dkauth/src/dkauth_mgr.c: No such file or directory.
Value returned is $16 = 0
(gdb) n
133 in /home/jintao/cvf-integration/apps/cvf/services/dkauth/src/dkauth_mgr.c
(gdb)
2、
skip 函数名:单步执行时不会进入到这个函数中执行
3、
skip file 文件名:单步调试时整个文件都会被跳过
skip -gfi common/*.c 单步调试时common目录下的所有.c文件都跳过
4、
格式: jump 行号或者函数名 :一般是在当前函数内跳转
(gdb) b dkauth_mgr.c:130
Breakpoint 3 at 0x3423cfb4: file /home/jintao/cvf-integration/apps/cvf/services/dkauth/src/dkauth_mgr.c, line 130.
(gdb) b dkauth_mgr.c:144
Breakpoint 4 at 0x3423d084: file /home/jintao/cvf-integration/apps/cvf/services/dkauth/src/dkauth_mgr.c, line 144.
(gdb) r
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /home/jintao/NT3/nt3_image/vdc-target.elf
[Switching to Thread 57005]
Breakpoint 3, load_vehicle_info () at /home/jintao/cvf-integration/apps/cvf/services/dkauth/src/dkauth_mgr.c:130
130 in /home/jintao/cvf-integration/apps/cvf/services/dkauth/src/dkauth_mgr.c
(gdb) p g_dkAuthMgr.preMaterials.vehicle_id_str
$2 = '\000'
(gdb) set pr
print prompt
(gdb) set print
address asm-demangle entry-values max-symbolic-offset pascal_static-members repeats symbol thread-events vtbl
array demangle frame-arguments null-stop pretty sevenbit-strings symbol-filename type
array-indexes elements inferior-events object raw static-members symbol-loading union
(gdb) set print null-stop
(gdb) p g_dkAuthMgr.preMaterials.vehicle_id_str
$3 = ""
(gdb) jump dkauth_mgr.c:144
Continuing at 0x3423d084.
Breakpoint 4, load_vehicle_info () at /home/jintao/cvf-integration/apps/cvf/services/dkauth/src/dkauth_mgr.c:144
144 in /home/jintao/cvf-integration/apps/cvf/services/dkauth/src/dkauth_mgr.c
(gdb) p g_dkAuthMgr.preMaterials.vehicle_id_str
$4 = ""
(gdb)