顺序图
我正在浏览一个大型开源应用程序的代码,想了解它的设计方式和工作原理。有没有一种工具可以将 C 和 C++ 代码逆向工程为序列图?
也许这可能有点牵强,但是当应用程序正在处理输入时,可以为我提供调用的函数列表(在各个模块中并按正确的顺序)的工具怎么样?或者帮助我快速分析给定的应用程序(尤其是具有大型代码库的应用程序)?
期待答案,因为我认为这一定是一个很好的话题。
I am browsing the code of a large open source application and would like to learn how it is designed and how it works. Is there a tool that can reverse engineer the C and C++ code into sequence diagrams?
May be this could be a bit far fetched but what about a tool which can give me the list of functions called (in various modules and in right order) when say the application is processing an input? Or help me quickly analyze a given application (esp one with a large code base)?
Looking forward to the answers as I am thinking this must be a well covered topic.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
有一些,但价格昂贵。 Rational Rose 在被 IBM 收购之前是最知名的。
C++ 语言的本质使得静态分析变得非常困难。这就是为什么很少有工具可以做到这一点。自从使用支持反射/内省的语言进行非 C++ 开发的激增以来,这种类型的工具确实已经将 C++ 抛在了后面。这并不是说没有,只是它们更难找到,而且通常是昂贵的 4GL 类套餐的一部分。 Rational Rose 主要是一个让您绘制系统图的工具,它将帮助跟踪组件并最终生成各种语言的源代码。它还可以在一定程度上将源代码逆向工程成图表。
Rational Rose 产品几乎被 Rational Requisite Pro 所取代,其中很大一部分功能(主要是 Java)被合并到 IBM 的 WebSphere 应用程序开发平台中,我认为现在称为 RAD。
Rational 工具以其全面性而闻名,以至于它们真正针对的是拥有同等规模员工的大型开发车间,通常从 50 多名开发人员开始,针对一个项目。
由于 C++ 语言的复杂性(从工具的角度来看)以及 Java 和 C# 等语言的流行,供应商确实不再重视 C++。
我对 Visual Studio 不太了解,它仍然支持 C++,但我愿意猜测 C++ UML 支持仅在昂贵的专业版本(如 Pro 或 Ultimate)中。
There are some but they are expensive. Rational Rose was the most well known before it got bought by IBM.
The nature of the C++ language makes it really hard to do static analysis. That is why there are so few tools that can do it. Since the surge in non-C++ development using languages that support reflection/introspection, this type of tooling has really left C++ behind. That isn't to say that are none, just they are harder to find and usually part of an expensive 4GL-like package. Rational Rose was mainly a tool that let you diagram a system and it would help track the components and eventually produce source code in a variety of languages. It could also reverse engineer source code into diagrams to a degree.
The Rational Rose product was pretty much superceded by Rational Requisite Pro, with a large portion of the functionality (focussed on Java) being folded into IBM's WebSphere Application Development platform, now referred to as RAD I believe.
The Rational tools were well known for being so comprehensive that they were really targeted for large development shops working with an equally large staff, usually starting at 50+ developers, for a single project.
Due to the complexity of the C++ language (from a tooling perspective), and the popularity of languages like Java and C#, vendors have really de-emphasized C++.
I'm not as knowledgeable about Visual Studio, which still supports C++, but I would be willing to guess that C++ UML support is only in the expensive professional editions like Pro or Ultimate.
C++ 到 UML(逆向工程/往返工程)。奇怪的是,阿尔托娃却没有。似乎其他大部分事情都做了。
Asked before C++ to UML ( Reverse engineer / Round-trip engineering ). Oddly enough Altova does not. Seems to do most everything else.
Sparx Systems 的 企业架构师 可以记录除了从源代码进行常规静态逆向工程之外,还可以从该跟踪生成应用程序并生成序列图。执行分析器支持(在 EA 9.2 中):
您至少需要 EA 的专业版,它在撰写本文时,单座许可证的费用为 199 美元(一点九九)。
有一个非常旧的演示视频可用在网站上(来自三个主要版本之前)。
Sparx Systems' Enterprise Architect can record the execution of an application and generate sequence diagrams from this trace, in addition to regular static reverse-engineering from source code. The Execution Analyzer supports (in EA 9.2):
You need at least the Professional edition of EA, which at the time of writing costs US$199 (one nine nine) for a single-seat license.
There's a very old demo video available on the site (from three major versions ago).