Knowledge Points:
First, the Linux Foundation
The core of this experiment: search-based-learn to use: Man, cheat, man-k, find (found path), locate (fast-looking), Whereis, which (where the command tools are used), grep (full-text search, regular expression).
Second, VIM
1.VI has three modes: command-line mode, insert mode, and bottom-line mode.
A) Vim tutorial:
For example: D delete operator;-W word (e.g.: DW deletes from cursor to the end of the next word (without the first character)).
b) Move the cursor:
[[Go to Previous ' {' in first column]
]] to go to the next "{" In the first column
{Go to previous empty row
} go to the next empty line
% Match parenthesis Move
* Match the current word of the cursor and move the cursor to the next. (# Previous)
c) Fast Adjust indent operation (input in normal mode)
>> Full line indent right (used to format code super cool)
<< Full line left fallback
Enter command-line mode to set the Shiftwidth value to control the number of characters to indent and rewind
d) Adjust the text position
: CE (center) command to center the contents of the bank;
: The RI (right) command causes the bank's text to be left;
: The LE (left) command keeps the contents of the bank on the right;
e) Windows operation
Ctrl+w < Some letters > Adjustment window
f) Document Encryption
$vim-X file (create encrypted document)
g) perform external commands in vim
! Executable external Shell part
h) Help system
Press F1 in normal mode to open Vim's own preset help document
Input in command line mode: H shiftwidth open a Help file named Shiftwidth
Input in command line mode: Ver display version and Parameters
i) function setting
1.vim function setting
command-line mode input: Set Nu (shows the number of rows), set value exit Vim will not be saved.
Vim configuration file ~/.VIMRC, open file for modification. (The VIM configuration file needs to be modified to permanently save the configuration.) )
2. Get current settings (input in command line mode)
: Set or: SE shows all modified configurations
: Set all displays all SetPoint values.
: Set option? Display the Set value of option
: Set Nooption cancels the current set value
Description of the 3.set function (input in command line mode)
: Set Autoindent (AI) sets auto indent
: Set Autowrite (AW) Sets AutoArchive, default not open
: Set Background=dark or light, setting the background style
: Set Backup (BK) sets automatic backup, default is not turned on
: Set Cindent (CIN) Sets C language style indentation
Third, GCC
• Preprocessing: gcc–e hello.c–o hello.i;gcc–e Call CPP
• Compile: Gcc–s hello.i–o hello.s;gcc–s Call CCL
• Assembly: Gcc–chello.s–o Hello.o;gcc-c Call as
• Link: gcc hello.o–o hello; gcc-o call ld
Note: the "-G" parameter is added at compile time
Four, GDB
1. The most basic commands are: GdB programm (Start gdb)
- B Set Breakpoints (4 breakpoints are set: Line breakpoint, function breakpoint, conditional breakpoint, temporary breakpoint)
- Run starts running the program
- BT Print function Call stack
- P View variable values
- C continue running from the current breakpoint to the next breakpoint
- N Single Step operation
- S Single Step operation
- Quit Quit GDB
2. Other Debug commands are:
- Change of display tracking variable value
- Until jump out of the loop
- Finish Jump function
- Help
Problems encountered:
1. Learn the Vim tutorial using "x" to delete the character at the cursor location, the character is deleted by mistake and will not be recalled.
Solution: Step by Step backward learning, learned to use the U key can be revoked.
2. Problem: GDB's n (next) command lets GDB execute the next line and then pause. The s (step) command acts like this, except that the step command enters the function when the function is called, so what should be preferred in actual use? Why?
Solution: Next: Précis-writers is N, single-step tracking program, when encountered function call, also do not enter this function body;
Step: Encountered a user-defined function, stepping into the function to run, and next calls the function directly, does not enter into the function body.
Step command, if there is a function call on the source line on which the step command will run, then the Step command causes GDB to enter the inside of the called function. Step is usually referred to as stepping into the command. This is also the difference from the next command.
(Reference: Textbook "Embedded Linux Application Development (page 70th)" and http://www.cnblogs.com/wangkangluo1/archive/2012/05/28/2521432.html)
3. Do not know under which software the use of GCC in the practice.
4. Practice the F key for the first time, as in this sentence: Abc.shiyanlou.eds when the cursor falls on the H letter, finding the B-letter cannot be found and can only be traced back to the cursor.
FIX: The second exercise, read the text to understand what is:f< letter > forward to find,f< letter > Backward lookup.
Summary experience:
1.vim Chinese text editing, when the input "I" Start editing, the previous letter key can not be used as a shortcut, must <ESC> back to normal mode of work can be used, but the keyboard on the upper and lower left and right keys and backspace in this environment can also be used (so, The latter is more useful).
2. While practicing, I found the "D and keyboard Right ARROW" combination: Delete the character that the cursor is in. "D and keyboard left-arrow" combine: Deletes the previous character of the cursor. "D and the UP ARROW or down arrow on the keyboard" combination: Delete the line where the cursor is located.
3. In fact, many symbols are relative (such as: [and]],{and}, one up and the other downward; F and F, in the opposite direction.)
4. Many commands, but most of the usage is very regular, parameters, options and different commands to match each other. The first exercise was in the Vim tutorial for in-depth understanding of the course, the second time in the Vim course of the experimental building, the second is obviously more comfortable than the first time, and there is still a lot of practice in the future to be able to skillfully apply and master their use.
5. The type of command to be entered should be paid special attention in which mode.
20135337--Information Security System Design Foundation second week study summary