2019-2020-1 20175320 "Information security system design basis" the third week of learning summary

2019-2020-1 20175320 "Information security system design basis" in the first week learning summary

First, the learning content summary

This week we understand and practice the use of gcc, gdb and use the makefile and on this basis. Around gcc, for this week can be divided into the following sections: the use of gcc -E, -S, -c these three parameters gradually compile c file; the function c file into the library, and the library function call; a program using the makefile automatically compiled; use gdb debugger. In this blog I used main.c program provided by the teacher as an example below shows the code.

Use of gcc -E, -S, -c these three parameters for c files compiled gradually

  • It should be noted here that the case of these three parameters can not be arbitrarily changed, and there is a command of these parameters can not operate simultaneously on multiple files.
  • If the file is not in the operation of the current directory, you can add the file path before the file name.
  • Multi-module operation, a plurality of c-compiled executable file directly, the file may be compiled into the c .o file, then .o file link.
  • During the process of compilation, warning prompt is negligible and does not affect the process of.
    The results of this part of the process and the operation portion as shown below:

The function c file into the library, and the library function call

  • Generation process static and dynamic library is very similar, are the first to get the compiler and assembler function called relocatable object program, and then create a library file from the command based on these documents, and finally in the process of compiling the main program as well as by -L -l parameters will link the main program and library
  • When a file operation is not in the current directory, you can add files to find the path in front of the file.
    The results of this part of the process and the operation portion as shown below:
    static library:

    dynamic library:

Use the program to automatically compile makefile

  • Write a good makefile file, you can use the make command files automatically compile, manipulate files in the makefile code if not in the directory makefile file is located, you need to add the file path before the file name
    in this case the makefile the code shown:

    operating results of makefile as follows:

    this example file structure as shown below:

Using gdb debugger

  • When using gdb debugging, need to use the -g parameter c files are compiled
    here I still use main.c As an example, the results of each gdb commands as shown below:
    gdb compiled:

    gdb List command:

    gdb info View Breakpoints :

    gdb the Next command:

Second, the problem of teaching and learning in the process of resolving

This week's content is not difficult, no problems were encountered very difficult to solve.

Third, the problem of debugging the code and resolution

  • Question 1: In accordance with the preparation of the makefile ppt, the display can not be found at runtime.
  • Problem 1 Solution: Modify the makefile code, add a file path name of the file before proceeding.
  • Question 2: Use the step command gdb debugging data can not be entered.
  • Problem 2 Solution: Use the next command debugger.

Fourth, code hosting

Fifth, last week summed up the wrong title examination

  • No test last week.

Six other (perception, thinking, etc., optional)

In content this week, I learned about a variety of ways to compile, directly compiled to generate a library function, write makefile code. The vast majority of problems encountered with the file path related, suggesting that I must pay attention to the file in everyday computer use in the path, be careful not to arbitrarily change a file's location.

Seven, learning progress bar

The number of lines of code (add / accumulate) Blog amount (add / accumulate) Learning time (add / accumulate) Important growth
aims 3000 lines 25 300 hours
the first week 54/54 1/1 13/13

Try recording "planned learning time" and "actual learning time" to the end see if you can improve their ability to plan. This study is very important work, is also useful. Consuming an estimated equation: Y = X + X / N, Y = XX / N, training more often, X, Y will close.

Reference: Why is estimated that software engineering software so hard , software engineering estimation method

Reference material

Guess you like

Origin www.cnblogs.com/nameless-student/p/11568381.html