有哪些静态分析工具可以帮助检测 CPU 字节序问题?

发布于 2024-09-13 23:09:49 字数 356 浏览 7 评论 0原文

我们的团队管理嵌入式大端 CPU 的代码库已有多年(10 多年)。 在嵌入式代码的开发和维护过程中,我们通常不会费心考虑字节序问题。

很快,我们将把这个代码库从大端 CPU 迁移到小端 CPU。

我们很好奇是否有人有任何特定静态分析或其他工具的经验来帮助实现这一转变。我们确实找到了英特尔提供的这份有用的白皮书来帮助我们入门:

http:// www.intel.com/design/intarch/papers/endian.pdf

谢谢!

Our team has managed a code base on an embedded big endian CPU for many years (10+).
We have generally not bothered to consider endian issues during this development and maintenance of this embedded code.

Soon, we will be moving this code base from a big endian CPU to a little endian CPU.

We are curious if anyone has experience with any particular static analysis or other tools to help with this transition. We did find this useful whitepaper from Intel to help us get started:

http://www.intel.com/design/intarch/papers/endian.pdf

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

白衬杉格子梦 2024-09-20 23:09:49

Code Integrity Solutions 的同事 Carl Ek 最近为 Dobbs 博士撰写了一篇文章“使用静态分析工具检测字节序问题”:http://www.drdobbs.com/windows/226000073

A colleague at Code Integrity Solutions, Carl Ek, recently wrote an article “Detecting Endian Issues with Static Analysis Tools” for Dr Dobbs: http://www.drdobbs.com/windows/226000073.

甜心小果奶 2024-09-20 23:09:49

事实上,我在文章中没有提到任何具体工具。它的目的是让读者对如何解决这个问题有一些想法。英特尔论文中的一般规则很好,但是它们非常通用,因此可能会遗漏许多可以在对单个客户的代码库和编码标准规则进行自定义检查时强制执行的特定内容。英特尔论文中的这些检查(大部分)可以在 Coverity 的静态分析 SDK 和 Klocwork 的 Checker Studio 中实现。我确信 Semantic Designs 的 DMS 在这种检测中非常有效还有:)。静态分析工具的可扩展性非常重要:编码问题可能非常微妙,任何预装的开箱即用检测可能会非常嘈杂。进行流/路径敏感分析也是可取的,因为字节序处理可以/通常受到基于(可能)静态可分析/可检测条件的防护/条件的保护。 ——卡尔

Indeed I didn't mention any specific tools in my article. It was meant to give the reader some thoughts about how to approach the problem. The general rules in the Intel paper are good, however, they are very generic, and thus can miss a lot of specific things that could be enforced in custom-checks for an individual customer's codebase and coding standard rules. Those checks in the Intel paper can be (mostly) implemented in Coverity's Static Analysis SDK and Klocwork's Checker Studio. I'm sure that Semantic Designs' DMS would be extremely effective in this detection as well :). Having extensibility to a static analysis tool is very important: the coding issues can be very subtle and any canned out-of-the-box detection could potentially be very noisy. Having a flow/path-sensitive analysis is also desirable, as endian processing can/is often protected with guards/conditionals based on (possibly) statically analyzable/detectable conditions. --carl

花开浅夏 2024-09-20 23:09:49

Klocwork 在其最新版本中引入了 Endian 分析(披露:我在那里工作)。完整的过程间分析,确保从网络或主机发送/接收数据时存在转换点。这里的技术白皮书更详细地解释了它。

http://www.klocwork.com/resources/endian-deadlock-multicore-挑战/

祝你好运! -布伦丹

Klocwork has introduced Endian analysis in its latest release (disclosure: I work there). Full inter-procedural analysis to ensure transformation points exist when sending/receiving from/to network or host. Technical whitepaper here that explains it in some more detail.

http://www.klocwork.com/resources/endian-deadlock-multicore-challenges/

Good luck! -Brendan

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文