开发者

Any static analysis tools that help detect CPU endian issues?

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 开发者_StackOverflow中文版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!


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.


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


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜