为了满足软件测试、软件调试和程序优化等领域对程序谱的需求,提出了基于插桩技术的程序谱构建模型,主要包括插桩预处理、双缓冲处理、有穷自动机处理识别插桩点、植入探针生成插桩代码、编译连接并执行插桩程序以收集执行轨迹构建程序谱。采用双缓冲处理机制,可有效提高源代码处理效率,有穷自动机能够准确识别插桩点。在软件错误定位中的应用结果表明基于插桩技术构建的程序谱可为准确、高效的程序理解和分析提供方便。
To meet the needs of software testing, software debugging and program optimization for program spectrum, a program spectrum construction model based on instrumentation technology is proposed. The model can be divided into five stages: pre-processing, double buffering, infinite state machine processing to identify instrumentation point, instrumented probe code, instrumented program execution to construct the program execution trace spectrum. Double buffering mechanism can effectively improve the efficiency of the code processing, and finite state machine algorithm can accurately identify instrumented point. Application results in software fault localization show that the program spectrum with our method can facilitate accurate and efficient program comprehension and analysis.