Linux git_gdb and makefile usage

Table of contents

git_gdb and makefile usage

1. gdb commands

2. make/Makefile

3. git


1. gdb commands

  • R/run  directly runs the program which is equivalent to ctrl+F5 of vs.
  • list /l  displays line numbers
  • Breakpoint: b (full name breakpoint )
    • Usage: b/breakpoint n (n is the line number)
    • Generally  b fun (function name) breakpoint is hit at the entrance of the function
  • Cancel breakpoint: d/delete n (number)
    • Can be canceled continuously
    • disabledisable  breakpointsenable  enable  breakpoints
  • info b  shows breakpoints
  • s/step  into the function (statement by statement)
  • n /next process by process
  • display var (variable name) is always displayed (similar to the monitor window)
    • display &  varView address
    • undisplay n (here is the number) cancel normal display
  • p/P  is only displayed once
    • p var (variable name)
  • finish  ends the current function
  • continue  running through the current breakpoint and going to the next breakpoint
  • until  jump to specified line
  • bt  view call stack
  • set var (variable) Modify the value of a variable
    Example: set var i=100

2. make/Makefile

make is a command Makefile is a file;

Makefile maintains two things: dependencies and dependency methods; the sum of make and Makefile can achieve the purpose of forming an executable program;

1. Create Makefile

2. Open with vim, try not to use spaces or blank lines.

make only executes one target dependency when scanning the makefile file. The default is the first one, so if you want to execute the corresponding make file (file name)

Example: make clean / If clean is at the top and test is at the bottom, it is make test.

3. git

Before using, check whether git is installed. If not, use sudo yum install git to install git.

1. First, gitee creates the library, and then copies the http link of the library.

      a.readme is similar to the manual

      b. After copying the link, enter it in Linux: git clone https://gitee.com/linux-learning.git (just paste the link), so that there will be one more file in the library.

2. Next is to upload the code

      c. git status can view the correspondence between local code and local warehouse

      d.git add file_name(file name)

      e.git commit -m "log information"

      f. Then just git push directly

 

Guess you like

Origin blog.csdn.net/weixin_63246738/article/details/131608104