总而言之, info 命令集是 GDB 中用于获取关于正在调试程序各个方面详尽信息的重要工具。 (gdb) info'info'must be followed by the name of an info command.List of info subcommands: info address -- Describe where symbol SYM is stored.info all-registers -- List of all registersandtheir contents,f...
1、首先需要用gcc(g++) 对源文件进行编译生成可执行文件,并且在编译时加上选项-g,把调试信息加到目标文件中。 2、假设生成的可执行文件为test,那么gdb test 可以用gdb打开test文件,然后通过break linenum设置断点。可以输入list查看源文件和行号,方便设置断点。断点设置好后就可以run命令运行到断点处了。 下面是转载...
1、注意使用gdb时,最好带上-g参数编译可执行文件。否则出现(No debugging symbols found in a.out) gcc -g main.c -o a.out 2、查看命令行可带参数帮助 gdb --help 3、查看命令行可使用命令及详情 (gdb) help all //查看所有命令 (gdb) help break //查看break 使用,其他命令也可单独help 4、gdb ...
Type"apropos word"to searchforcommands related to"word"...Readingsymbolsfromdemo...// 打断点(gdb) b9Breakpoint1at0x1167: file demo.c, line9.// 运行(gdb) runStartingprogram:/home/jjj/pj/demo// 在断点处停止Breakpoint1, main () at demo.c:99intmain() {// 下一行(gdb) next10int num...
38.list:重复上一次的list指令,也可以直接按回车键,重复上次指令。 39.set listsize count:设置每次显示的行数。 40.show listsize:显示已设置的显示行数。 41.list first,last:显示指定起始行到结束结束行的源文件。 42.list ,last:显示以指定的last为结束行,显示10行。
/grid/common/pkgsData/gcc-v4.1.2p2/Linux/RHEL3.0-1H2006-x86_64/include/c++/4.1.2/bits/allocator.h, /grid/common/pkgsData/gcc-v4.1.2p2/Linux/RHEL3.0-1H2006-x86_64/include/c++/4.1.2/ext/new_allocator.h, /grid/common/pkgsData/gcc-v4.1.2p2/Linux/RHEL3.0-1H2006-x86_64/include/c++...
GDB offers a big list of commands, however the following commands are the ones used most frequently:b main - Puts a breakpoint at the beginning of the program b - Puts a breakpoint at the current line b N - Puts a breakpoint at line N b +N - Puts a breakpoint N lines down ...
common -- Print out the values contained in a Fortran COMMON blockinfo copying -- Conditions for redistributing copies of GDBinfo dcache -- Print information on the dcache performanceinfo display -- Expressions to display when program stopsinfo extensions -- All filename extensions associated ...
commands 命中断点时,列出将要执行的命令 continue 从断点开始继续执行 delete 删除一个断点或监测点;也可与其他命令一起使用 display 程序停止时显示变量和表达时 down 下移栈帧,使得另一个函数成为当前函数 frame 选择下一条continue命令的帧 info 显示与该程序有关的各种信息 ...
set auto-load gdb-scripts -- Enable or disable auto-loading of canned sequences of commands scripts set auto-load libthread-db -- Enable or disable auto-loading of inferior specific libthread_db set auto-load local-gdbinit -- Enable or disable auto-loading of .gdbinit script in current dir...