当前位置:网站首页>gcc/g++ use
gcc/g++ use
2022-08-08 05:30:00 【asibble】
gcc/g++ use
This is the compiler, doing related things.This is an open source compiler that compiles c and c++.
Procedure:
1, Preprocessing
2, Assembly
3, Link
Preprocessing
gcc -E does preprocessing and redefines an output file.
After preprocessing
gcc -E main.c -o main.iGenerate related .i files and become related things.
Compile (generate assembly)
gcc -c main.s -o main.oAssembly generates the content of main.o file, which can be directly preprocessed into assembly.
Assembly (generates machine-identifiable code)
gcc -c main.c -o main.oGenerate .o files directly.
Link (generate executable or library)
gcc main.o -o mainGenerate the main file and turn it into something corresponding.
Library
When compiling and linking, the library files are processed differently, and the static library and dynamic library are different.
Static library
Static library means that when compiling and linking, all the code of the library file is added to the executable file, so the generated file is relatively large, but the library file is no longer needed at runtime.The suffix is usually ".a"
Dynamic library
The library is not placed in the executable program, and the library file is dynamically extracted during the running process.
Save space and overhead on the system, the dynamic library suffix is ".so".
Debugger gdb use
The use of gdb is basically related to the use of release mode.The basic things are used in the same way as debugging, but they are adjusted with simple code, not related to the previous steps.(Xcode can also perform related operations)
The relevant executable program is obtained after the gcc reaction, and then
gdb test //test executable program1,b (break) + line number: break point
2, d (delete) + breakpoint number: delete breakpoint
3,l + line number: display code
4, s (step): statement by statement (enter function)
5, n (next): process by process
6, display && undisplay: line display or cancel normal display
7, until + line number: jump to the specified line
8, r(run): run the program
9, c (continue): from one breakpoint to the next breakpoint
10, finish: stop when the execution completes a two-digit number*!
11, j(jump) + line number: jump to the specified line
12, k (kill): terminate the program running
13,i(info) : View the value of the local variable of the current stack frame
边栏推荐
- Week 8 Generative Adversarial Networks(生成对抗网络 GAN)
- Flutter 教程之高效且精美的滚动组件Slivers (教程含源码)
- 分布式事务 :可靠消息最终一致性方案
- C语言日记 11 switch语句(分支结构程序设计)
- TSF Microservice Governance Combat Series (2) - Service Routing
- 查询跟踪多家快递单号,筛选某一时间发货的单号
- 如何保存页面的当前的状态
- 基础了解虚拟 DOM
- Error: [Intervention] Unable to preventDefault inside passive event listener due to target ...
- [Redis] Redis Learning - Transaction
猜你喜欢
随机推荐
【Win10】Several sleep problems and countermeasures
Week 9 10 Neural Networks
Leetcode sword 】 refers to the Offer (special commando) summary
Object.prototype.toString()如何判断数据类型及注意点
Week 8 Generative Adversarial Networks(生成对抗网络 GAN)
Lecture 84 Biweekly t4 6144 and Lecture 305 t4 6138
【图像处理】matlab基础图像处理 | 图像载入、图像添加噪声、图像滤波、图像卷积
Hard Disk Basics
【u-boot】u-boot的驱动模型分析
postman---postman parameterization
阿里云的数据库怎么提高访问速度的本地的打开的方式是www.zgysffm.com怎样的?
《动机与人格》笔记(一)——人类似乎从来就没有长久地感到过心满意足
28.异常检测
cs软件ui构建办法
数据库ADB多个字符,想要导入到ES存为nested的类型,这个支持吗?有对应的文档吗
温故知新—Activity的五种启动模式
nonebot插件:说话的艺术
Use of Filter
Leetcode78. 子集
Week 8 Generative Adversarial Networks









