当前位置:网站首页>Explanation of vim, makefile and GDB tools
Explanation of vim, makefile and GDB tools
2022-06-21 13:36:00 【Longbow dog learning C】
One .vim
1.vim What is it? ?
We are beginning to learn c Language , Most of them have to learn vs(visual studio) Tools , In this tool, we can edit code or debug code in this software , It is a versatile software .
and Linux We need to learn several tools to implement the whole process ,vim Is a tool for editing code .
2.vim Multimodal ?
vim There are multiple patterns in the tool , common 10 Several patterns , In order to realize code editing in different scenarios , The most common one we use is normal ( command ) Pattern , Insert mode and last line mode .
In normal mode, we can delete the existing code , Copy move (yy Copy dd Clip p Paste )
Input i Enter insertion mode , Before data input
Use shift and ; Enter last line mode , Used to save and exit files
Two .makefile
Study makefile We need to learn the compilation process first
1.gcc/g++ Use
The original code file needs a series of processing ( compile ) To generate a processable file . and gcc yes c Language code file implementation processing compiler ,g++ yes c++ Implemented compiler .
The whole process can be roughly divided into four parts , Preprocessing , compile , assembly , link
2. What has been done in the four processes
- Preprocessing : Mainly for macro replacement , To comment and other operations
gcc -E hello.c -o hello.i here E It means to stop compiling after preprocessing ,o After that is the generated object file ,(.c) The file is preprocessed to generate (.i) file
- compile : Check for syntax errors , Code normalization , Generate assembly language after no error
gcc –S hello.i –o hello.s S Description stop after compilation ,(.i) The file is compiled and generated (.s) file
- assembly : Generating machine recognizable code
gcc –c hello.s –o hello.o C Description stop after the assembly process ,(.s) Files are generated after assembly (.o) file
- link : Generate executable files
gcc hello.o -o hello Same as above
Finally, I can just talk about the following
3. What is? makefile
The implementation of a project is inseparable from numerous source files , How to compile these files has become a problem , and makefile and make Defines the Compilation Rules of the file .
Write well makefile after , Just one make You can make the project compile automatically .
makefile It's a document ,make It's an order , Use both together .
Let's go straight to one makefile

g++ It shows that the language we use is c++, In the figure g++ After [email protected] Represents the left of the colon in the previous line parser $^ It stands for the one to the right of the colon parser.cc $(FLAG) Represents the first line of code
amount to g++ -o parser parser.cc ( first line )
according to ( rely on )parser.cc File generation target parser Executable file
among clean After represents input make clean It will delete parser file
3、 ... and .gdb
1. What is? gdb
gdb It's a debugging tool , There are two modes of program release ,debug and release, Only the former can be debugged
and Linux gcc/g++ The default generation is the offending pattern , To debug compile time +g

after gdb The executable is just

r function ,break n Give it to n Line break point ,delete breakpoint n Delete the first n Line breakpoint .
info break View breakpoint information n Run the next step .
边栏推荐
- Tami dog sharing: the way of property right transaction and the significance of data-based property right transaction market
- Voltage detection and current detection based on stm32
- Is it safe to open a securities account by downloading the app of qiniu business school? Is there a risk?
- PHP uses grafika to synthesize pictures and generate poster images
- 8. structure
- Shell process control - 35. Multi branch case conditional statements
- Chapter IX Cisco ASA application nat
- PingCAP 入选 2022 Gartner 云数据库“客户之声”,获评“卓越表现者”最高分
- Implementation principle and application practice of Flink CDC mongodb connector
- SCCM creates a client collection based on the installed app and periodically pushes application updates
猜你喜欢

Hands on data analysis unit 2 section 4 data visualization

Huawei cloud releases desktop ide codearts
MySQL constraints (descriptions of various conditions when creating tables)

###数据库的高可用配置(mysql)

Use map set or list set to store list set

Analysis on the wallet system architecture of Baidu trading platform

PingCAP 入选 2022 Gartner 云数据库“客户之声”,获评“卓越表现者”最高分

Kubernetes快速實戰與核心原理剖析

PHP uses grafika to synthesize pictures and generate poster images

Is the live interactive function of the applet running in the app?
随机推荐
Interpretation of tamigou project: 34% equity transfer of Jining Huayuan Project Management Co., Ltd
7. pointer
4. procedure flow structure
The new plan for national treasures - the exclusive digital collection of the four museums is coming!
How to write test cases
Pretraining Weekly No. 50: No Decode converter, neural prompt search, gradient Space reduction
What is Devops in an article?
[course assignment] floating point operation analysis and precision improvement
3D slicer saves segmentation results
Kubernetes' fast practice and core principle analysis
Pingcap was selected as the "voice of customers" of Gartner cloud database in 2022, and won the highest score of "outstanding performer"
3. operator
微证券开户正规安全吗,怎么操作开户?
Atguigu---- conditional rendering
Kube Prometheus grafana installation plug-in and grafana image renderer
《网络是怎么样连接的》读书笔记 - ADSL
Using slurm cluster computing node debugger in vscode
scrapy_ Redis distributed crawler
C language elementary (VII) structure
Explanation of common mesh generation methods in workbench