一些了解 GCC 源代码的指针
我是一名学生,致力于为多核处理器优化 GCC。我尝试查看源代码,但很难跟踪它,因为我需要在后端添加一些代码。任何人都可以建议一些好的资源来解释不同阶段的代码流程。 还建议一些用于调试GCC的开发环境,主要是单步执行代码。在windows上可以吗?
I'm student working on optimizing GCC for multi-core processor. I tried going through the source code, it is difficult to follow through it since I need to add some code to the back end. Can anyone suggest some good resource which explains the code flow through the different phases.
Also suggest some development environment for debugging GCC mainly to step through the code. Is it possible on windows?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
作为起点,请参阅 GCC 网站上的链接和选定读物。我认为您特别感兴趣的是:
如果您想在 Windows 上进行开发,您可能需要从 MinGW(Minimalist GNU for Windows)编译器套件源(它包括 GNU GDB 调试器)开始,这是一个GCC 到 Windows 的端口。
对于舒适的开发环境我帮不了什么忙,因为我不使用 C++ 开发。但我想你需要一个好的 C/C++ IDE:看看 这种比较,有很多适用于 Windows 的免费/开源 IDE。
更新:我认为ICI也可以是您感兴趣:
.. 与集体调整保护伞下的其余项目一样。
注意: 正如 BlueRaja 在评论中所写,“编译器是最复杂的程序之一”,这种说法有些夸张:编译器有非常简单的编译器和非常复杂的编译器。但在编译器理论中(一旦你研究了它)并没有什么深奥的。 GCC 是一个复杂的程序,需要理解为任何大、文档不完善的程序1。所以 rizwanhudda 不要灰心:开始研究可用的文档,然后询问 GCC 开发人员(在 GCC irc 频道上,如 由 nvl 或 GCC 开发者邮件列表建议< /a>)来解释哪些内容记录得不好(或根本没有)。
As a starting point see Links and Selected Readings on GCC site. Of particular interest to you, I think, are:
If you want to develop on Windows you probably need to start from MinGW (Minimalist GNU for Windows) Compiler Suite sources (it includes GNU GDB debugger), which is a port of GCC to Windows.
For a comfortable development environment I cannot help much because I don't develop in C++. But I suppose a good IDE for C/C++ is what you need: have a look at this comparison, there are plenty free/open source IDEs for Windows.
Update: I think ICI can also be of interest to you:
.. as the rest of projects under the Collective TUNING umbrella.
Note: Writing "compilers are one of the most complex programs there are", as BlueRaja wrote in comments, is an overstatement: there are very simple compilers and very complex compilers. But in compiler theory (once you have studied it) there is nothing esoteric. GCC is a complex program to understand as whatever BIG, poorly documented program out there1. So rizwanhudda don't be discouraged: start studying the documentation available and then ask GCC developers (on GCC irc channel, as suggested by nvl or GCC developers mailing list) to explain what is poorly (or not at all) documented.
我建议你使用GCC irc频道,它是为了讨论GCC的发展。
I would suggest you to use the GCC irc channel, it is meant for discussion of development of GCC.