第一:启动
在shell下敲gdb命令即可启动gdb,启动后会显示下述信息,出现gdb提示符。
添加编译指令:gcc -g a.c -o test
打开指令:gdb test
或者 gdb 然后输入:file test
➜ example gdb GNU gdb (Ubuntu 8.1.1-0ubuntu1) 8.1.1 Copyright (C) 2018 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86