2019-2020-1 20175204 "Information security system design basis" in the first week learning summary
learning target
Familiar development environment under Linux
2. familiar with the basic operation of vi
3. familiar with the basic principles of gcc compiler
4. familiar with common gcc compiler options
5. skilled use gdb debugger techniques
6. familiar with the basic principles and grammar makefile specification
7. the method of generating call control static and dynamic libraries
8. Almost understanding C program simulation modules, the principles of "high cohesion, low coupling" decomposition module
9. understand the concept of the link
Laboratory building learning content summary
Highlights:
-gcc Description:
GNU CC (referred to as gcc) compiler system GNU project in compliance with ANSI C standard, can be compiled with C, programs written in C ++ and Object C and other languages. gcc is a cross-platform compiler, it can be for a variety of different hardware platforms to develop software architecture on the current CPU platform, it is especially suitable for the development of the compiler in embedded field.
- the compilation process:
Pretreatment: gcc –E hello.c –o hello.i;gcc –E
call cpp
compiler: gcc –S hello.i –o hello.s;gcc –S
call ccl
Assembly: gcc –c hello.s –o hello.o;gcc -c
call as
links: gcc hello.o –o hello ;gcc -o
call LD
GDB:
to add "-g" parameter attention when using the GCC compiler. GDB basic commands are:
gdb programm
(start GDB)
b breakpoint (breakpoint to be set up four kinds: line breakpoints, function breakpoints, conditional breakpoints, temporary breakpoint)
RUN Start the program
bt print function call stack
p see the value
c from the current continues to run until the next breakpoint breakpoint
n single step
s single step
quit from the GDB
Laboratory building exercises:
1. Enter the following code using vim, use the link "K" to find help documentation, the following codes are entered head.h add.c sub.c div.c mul.c main.c in
- textbook learning and problem-solving process:
-1 problem: Since last semester experiment using a virtual machine to adjust the network settings result now has been unable to connect to the network based on the Internet can not resolve.