Linux gcc and gdb simple operation command

  

gcc – o (2.1.out executable file can be arbitrary) 2.1.c Compile this program (vim has automatic incomplete code function.. I will learn later) and then The compiled program adds executable permissions. Chmod +x a.out./2.1.out The above file name run command

Debug gdb environment: terminal input gdb start debugging gcc -g -o a.debug ac ##Generate a.debug debug file (this The file can also be run) ####### Add the -g parameter so that the compiled executable can be tested by gdb. File a.debug ####Command loader a.debuglist 1 ####### can display the original code break n #########Set breakpoints info breakpoints ######## #View all breakpoints next ############ commands, the program will stop the next line, "continue", the program will stop at the next breakpoint run ####### Enter the following command to run the program. Print i #####View the value of the breakpoint i q ####### Exit gdb (I don't think gdb is a good debugging environment, I feel that there is no eclipse under Linux, it can also debug c in c++ program. Hope to master)

View memory:\\b

Copyright © Windows knowledge All Rights Reserved