📜  编译器和调试器之间的区别

📅  最后修改于: 2021-06-28 07:04:28             🧑  作者: Mango

1.编译器
顾名思义,编译器是用于将代码转换为机器指令的过程。它只是将源代码从高级编程语言转换为低级机器语言。它基本上是一个复杂的软件,可以同时执行代码优化和代码生成。它还使最终代码更有效,并且针对执行时间和存储空间进行了优化。

2.调试器
顾名思义,调试器是一个用于从代码中删除错误的过程。它仅允许测试和调试其他程序。有时,它还提供两种操作模式,即完全和部分仿真。它用于防止软件或系统的错误操作。它还使用指令集仿真器,而不是直接在处理器上运行程序,以实现对其执行的更高级别的控制。

编译器和调试器之间的区别:

Compiler 

Debugger

It is a computer program used to translate high-level language into set machine language.  It is a computer program used to test and debug target programs. 
It generally allows computer to run understand program without need of programming software used to create it.   It generally allows you to uncover and diagnose errors in computer software.  
It is very important to convert text that programmer writes into format that CPU understands.   It is very important to provide maximum useful information of data structures and allows easy interpretation. 
It takes less time as compared to debugger.  It takes more time as fixing some errors may introduce others. 
Compiled programs might have some errors or bugs.  Debugged program cannot have any errors.  
It has capability to detect syntax Errors and compile time errors.     It provides more capabilities to detect errors in programs as compared to compiler.  
It generates IL (Intermediate Language) code. It checks IL code line by line.  
It is more difficult task to design and develop a compiler.   It is less difficult to design and develop a debugger as compared to compiler.  
It performs various tasks such as pre-processing, parsing, semantic analysis, lexical analysis, etc.   It performs various tasks such as check and change data contents, detect and remove existing potential errors, etc.