arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1309.5152cs.PLcs.SE
收藏

一种动态反向代码生成方法对不确定性程序的验证

A Case for Dynamic Reverse-code Generation to Debug Non-deterministic Programs

Jooyong Yi

摘要:

回溯(即,反向执行)帮助调试器的用户沿着程序的执行路径自然地向后思考,并且向后思考使得定位错误的起源变得容易。到目前为止,回溯主要通过状态保存或检查点来实现。然而,这些实施方式固有地不缩放。与此同时,一种基于反向代码生成的回溯方法似乎很有前途,因为执行反向代码可以在不保存状态的情况下恢复程序的先前状态。在文献中,可以找到生成反向代码的两种方法:(a)静态反向-代码生成,其在开始调试会话之前通过静态分析来预生成反向代码,以及(b)动态反向-代码生成,其通过在调试会话期间即时应用动态分析来生成反向代码。特别是,我们在以前的工作中支持后者,以适应程序的非确定性,例如,多线程。为了证明我们的动态反向代码生成的有用性,本文提出了一个案例研究的各种回溯方法,包括我们的。我们比较了内存使用的各种回溯方法在一个简单但不平凡的例子,一个有界缓冲区的程序。在这种情况下,非确定性的程序,如有界缓冲区的程序,我们的动态反向代码生成优于现有的回溯方法的内存效率。

英文摘要:

Backtracking (i.e., reverse execution) helps the user of a debugger to naturally think backwards along the execution path of a program, and thinking backwards makes it easy to locate the origin of a bug. So far backtracking has been implemented mostly by state saving or by checkpointing. These implementations, however, inherently do not scale. Meanwhile, a more recent backtracking method based on reverse-code generation seems promising because executing reverse code can restore the previous states of a program without state saving. In the literature, there can be found two methods that generate reverse code: (a) static reverse-code generation that pre-generates reverse code through static analysis before starting a debugging session, and (b) dynamic reverse-code generation that generates reverse code by applying dynamic analysis on the fly during a debugging session. In particular, we espoused the latter one in our previous work to accommodate non-determinism of a program caused by e.g., multi-threading. To demonstrate the usefulness of our dynamic reverse-code generation, this article presents a case study of various backtracking methods including ours. We compare the memory usage of various backtracking methods in a simple but nontrivial example, a bounded-buffer program. In the case of non-deterministic programs such as this bounded-buffer program, our dynamic reverse-code generation outperforms the existing backtracking methods in terms of memory efficiency.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑