作者投稿和查稿 主编审稿 专家审稿 编委审稿 远程编辑

计算机工程

• 体系结构与软件技术 • 上一篇    下一篇

基于字节码插桩的多线程调试工具

周一耒a,于海波a,钟浩b   

  1. (上海交通大学 a.软件学院;b.电子信息与电气工程学院,上海 200240)
  • 收稿日期:2015-11-13 出版日期:2016-11-15 发布日期:2016-11-15
  • 作者简介:周一耒(1991—),男,硕士研究生,主研方向为程序分析;于海波,助理教授、博士;钟浩,副教授、博士。
  • 基金资助:
    国家自然科学基金(61572313)。

Multithreaded Debugging Tool Based on Bytecode Instrumentation

ZHOU Yilei a ,YU Haibo a ,ZHONG Hao b   

  1. (a.School of Software;b.School of Electronic Information and Electrical Engineering,Shanghai Jiaotong University,Shanghai 200240,China)
  • Received:2015-11-13 Online:2016-11-15 Published:2016-11-15

摘要: 在软件演化过程中,代码的调试是不可或缺的重要环节。对于多线程程序,线程的交错和调度是非确定的,不同的线程调度会产生不同的结果,程序员较难调试多线程程序。为此,对实际项目中多线程程序出现的错误进行分析,提出一种新的多线程调试工具,并给出顺序点概念。设计用于调试的线程调度语言,在字节码层面对测试程序进行插桩,使线程按照期望的顺序调度。在此基础上实现一个Eclipse上的调试插件。实验结果表明,与现有工具IMunit相比,该调试工具减少了程序员的工作量,并拓展了两类程序的调试场景,具有较好的实用性。

关键词: 多线程, 调试, 字节码, 插桩, 领域特定语言, 插件

Abstract: During the evolution of software,the debugging of programs is an important and necessary process.For multithreaded programs,the interleaving and scheduling are non-deterministic.Different scheduling can give different results,so it is difficult for developers to debug a multithreaded program.Therefore,this paper analyzes the concurrency bugs in real projects,presents a new multithreaded debugging tool,and proposes the concept of sequence point.It designs the scheduling language for debugging,instruments the test programs in bytecode level,and makes threads schedule in a desired sequence.It implements a debugging plugin in Eclipse.Experimental results show that compared with existing tool IMunit,the tool reduces developers’ workload and enhances two debugging scenarios.It has better availability.

Key words: multithreading, debugging, bytecode, instrumentation, domain-specific language, plugin

中图分类号: