Information Security Programming Basics second Week study summary

Source: Internet
Author: User

: tabe fn Edit file in a new tab FN
GT switch to next tab page
GT Switch to previous tab page
: TABR switch to the first tab page
: tabl switch to the last tab page
: TABM [n] Moves the current tab to the Nth tab
Yes, as you can imagine, with Eclipse, UE and other tabs is a meaning!
window Commands
ctrl+w s horizontal split window
ctrl+w w Switch window
ctrl+w Q exits the current window (this command does not affect other windows because there are multiple files at the same time)
ctrl+w v vertical split window


: W writes buffer to file, saving modify
: Wq Save changes and exit
: x Save changes and exit
: Q Exits, if the buffer has been modified, it will prompt
: q! Force quit, discard modifications
Find Replacements
/pattern Backward search string pattern
? pattern searches forward string pattern
N Next match (if yes/search, then down next,? Search is up next)
N Previous match (IBID.)
:%s/old/new/g Search entire file, replace all old with new
:%S/OLD/NEW/GC searches the entire file, replaces all old with new, and each time you confirm whether to replace
Copy and paste
DD Delete the line where the cursor is located
DW Delete one word (word)
x Delete current character
X Delete the previous character
D Delete to end of line
yy Copy a row, this command can be followed by a number, identity copy multiple lines, such as 6yy, to start copying 6 rows from the current line
yw copy a word
y$ Copy to end of line
p Paste the contents of the clipboard below the current line
P Paste the Clipboard contents to the top of the current line
]p with indented paste, Vim automatically adjusts the indentation of the Code
"A registers content in/into a register, can support multiple pasteboard

h,j,k,l, down, left, right .
ctrl-f up a page
ctrl-b down one page
% jumps to the parentheses that match the current bracket, as currently in {, jumps to the matching}
W Jump to the next word, split by punctuation or word
W jumps to the next word, long jump, as end-of-line is considered a word
e jumps to the end of the next word
E jump to the end of the next word, long jump
b jumps to the previous word
B jump to the last word, long jump
0 jumps to the beginning of the line, whether or not indented, jumps to the No. 0 character
^ jumps to the first character of the beginning of a line
$ jump to end of line
GG jumps to the first line of the file
GD jumps to the declaration of the variable at which the cursor is currently located
[n]g jumps to Nth row, such as 0G, which is equivalent to gg,100g is the 100th line
FX finds the X character in the current line and jumps to
; Repeat the previous F command without repeating the input FX
TX is similar to FX, but only jumps to the previous word of X prompt
FX and FX are in the opposite direction
), (jump to Upper/Next Statement
* Find the word where the cursor is located and look down
# Find the word where the cursor is located, look up
`. Jump to last edit location
move on the screen

H Move the cursor to the top line on the current screen
M moves the cursor to the middle line on the current screen
L Move the cursor to the bottom line on the current screen
Bookmark
Ma saves the current position as a label
' a jumps to label a
Edit
R replaces one character
J connect the next line and the current row as a row
CC Deletes the current line and enters edit mode
CW Deletes the current word and enters edit mode
C $ Erases content from the current position to the end of the line and enters edit mode
s Delete the current character and enter edit mode
S Delete the line of the cursor and enter edit mode
XP swaps the current character and the next character
u undo
Ctrl+r Redo
. Repeat last Edit command
~ Toggle Case, current character
G~IW Toggle the case of the current word
GUIW the current word into uppercase
GUIW the current word into lowercase
>> Move the current line one unit to the right
<< moves the current line one unit to the left (one tab character)
= = Auto Indent current line

Insert Mode
I enter insert mode from the current cursor
I go into insert mode and place the cursor at the beginning of the line
a append mode, with the cursor positioned after the current cursor
A Append mode with cursor at end of line
o Add a new line below the current line and enter insert mode
O Add a new line above the current line and enter insert mode
ESC exits insert mode
Visual Mode
Tag Text
v Enter visual mode, single character mode
V Enter visual mode, line mode
Ctrl + V enters visual mode, column mode, similar to UE's column mode
o jump cursor to another endpoint of the selected block
U Turn the contents of the selected block into uppercase
O jump cursor to another endpoint of the block
AW Select a word
AB selects everything in parentheses, including the parentheses themselves
AB selects all contents of {} brackets
IB selects the bracketed content without parentheses
IB selects the contents of {} without {}

to act on a marker
> block Right Shift
< block shift left
y copy block
d Delete Block
~ the size of the content in the toggle block

2. GCC

GNU CC (referred to as GCC) is an ANSI C-compliant compilation system in the GNU project that compiles programs written in languages such as C, C + +, and object C. GCC is also a cross-platform compiler that can develop software on the current CPU platform for a variety of hardware platforms of different architectures, so it is especially suitable for development in the embedded domain.

The process of compiling the code for GCC is as follows:

We can divide the compilation process into four steps to compile hello.c to generate executable Hello as an example, such as:

    • Preprocessing: Gcc–e hello.c–o hello.i;gcc–e Call CPP
    • Compilation: Gcc–s hello.i–o hello.s;gcc–s Call CCL
    • Compilation: Gcc–c hello.s–o hello.o;gcc-c Call as
    • Link: gcc hello.o–o hello; gcc-o call ld

The compilation process is difficult to remember, we simplify, the first three steps, GCC parameters linked to "ESc", the corresponding input file suffix is "ISO", so memory is much easier.

Another important point to learn about GCC is: reference materials, "in-depth understanding of computer systems" 7.6, 7.10, learning Static library, the production of dynamic library.

3. gdb

Recommended to use CGDB, better than GDB, familiar with the VC debugging methods, you can use DDD. Note Use GCC to compile with the "-G" parameter. Refer to the GDB Reference Card GDB's 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

4. Other

Change of display tracking variable value

Until jump out of the loop

Finish Jump function

Help

Information Security Programming Basics second Week study summary

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.