首页 | 本学科首页   官方微博 | 高级检索  
相似文献
 共查询到20条相似文献,搜索用时 15 毫秒
1.
On Paper     
Spinellis  D. 《Software, IEEE》2007,24(6):24-25
This paper tries to devise an algorithm for analyzing initializers for C arrays and structures. The CScout refactoring browser is used to look for possible differences between closed and open source code. Unlike the other code bases, Sun's code didn't appear to use any exotic compiler extensions, so CScout uncomplainingly devoured one file after the next. Then, after approximately six hours of processing and 80 percent along the way, it reported a syntax error. Most errors encountered when processing C code with CScout are easy to handle. A macro definition is added to simulate a compiler built-in-function.  相似文献   

2.
一种基于模型检验程序分析技术的前端工具研究   总被引:1,自引:0,他引:1  
叶俊民  谢茜  金聪  李明  张振方 《计算机科学》2010,37(5):118-122174
提出了一种用模型检验技术对程序进行分析的方法,其主要思想是将C/C++源代码转换为与控制流图等价的Kripke结构,用CTL公式描述待验证的源程序性质,使用NuSMV模型检验工具实施具体的程序分析。基于这一思想,设计并实现了一个自动将C/C++源代码转换为NuSMV输入的工具。所做的实验验证表明,该方法能够有效地对程序进行分析。  相似文献   

3.
GridMD is a C++ class library intended for constructing simulation applications and running them in distributed environments. The library abstracts away from details of distributed environments, so that almost no knowledge of distributed computing is required from a physicist working with the library. She or he just uses GridMD function calls inside the application C++ code to perform parameter sweeps or other tasks that can be distributed at run-time. In this paper we briefly review the GridMD architecture. We also describe the job manager component which submits jobs to a remote system. The C++ source code of our PBS job manager may be used as a standalone tool and it is freely available as well as the full library source code. As illustrative examples we use simple expression evaluation codes and the real application of Coulomb cluster explosion simulation by Molecular Dynamics.  相似文献   

4.
Parallelism has become one of the most extended paradigms used to improve performance. However, it forces software developers to adapt applications and coding mechanisms to exploit the available computing devices. Legacy source code needs to be re-written to take advantage of multi- core and many-core computing devices. Writing parallel applications in a traditional way is hard, expensive, and time consuming. Furthermore, there is often more than one possible transformation or optimization that can be applied to a single piece of legacy code. Therefore many parallel versions of the same original sequential code need to be considered. In this paper, we describe an automatic parallel source code generation workflow (REWORK) for parallel heterogeneous platforms. REWORK automatically identifies promising kernels on legacy C++ source code and generates multiple specific versions of kernels for improving C++ applications, selecting the most adequate version based on both static source code and target platform characteristics.  相似文献   

5.
The mobile agent‐based computational steering (MACS) for distributed applications is presented in this article. In the MACS, a mobile agent platform, Mobile‐C, is embedded in a program through the Mobile‐C library to support C/C++ mobile agent code. Runtime replaceable algorithms of a program are represented as agent services in C/C++ source code and can be replaced with new ones through mobile agents. In the MACS, a mobile agent created and deployed by a user from the steering host migrates to computing hosts successively to replace algorithms of running programs that constitute a distributed application without the need of stopping the execution and recompiling the programs. The methodology of dynamic algorithm alteration in the MACS is described in detail with an example of matrix operation. The Mobile‐C library enables the integration of Mobile‐C into any C/C++ programs to carry out computational steering through mobile agents. The source code level execution of mobile agent code facilitates handling issues such as portability and secure execution of mobile agent code. In the MACS, the network load between the steering and computing hosts can be reduced, and the successive operations of a mobile agent on multiple computing hosts are not affected whether the steering host stays online or not. The employment of the middle‐level language C/C++ enables the MACS to accommodate the diversity of scientific and engineering fields to allow for runtime interaction and steering of distributed applications to match the dynamic requirements imposed by the user or the execution environment. An experiment is used to validate the feasibility of the MACS in real‐world mobile robot applications. The experiment replaces a mobile robot's behavioral algorithm with a mobile agent at runtime. Copyright © 2009 John Wiley & Sons, Ltd.  相似文献   

6.
A software repository provides a central information source for understanding and reengineering code in a software project. Complex reverse engineering tools can be built by analyzing information stored in the repository without reparsing the original source code. The most critical design aspect of a repository is its data model, which directly affects how effectively the repository supports various analysis tasks. This paper focuses on the design rationales behind a data model for a C++ software repository that supports reachability analysis and dead code detection at the declaration level. These two tasks are frequently needed in large software projects to help remove excess software baggage, select regression tests and support software reuse studies. The language complexity introduced by class inheritance, friendship, and template instantiation in C++ requires a carefully designed model to catch all necessary dependencies for correct reachability analysis. We examine the major design decisions and their consequences in our model and illustrate how future software repositories can be evaluated for completeness at a selected abstraction level. Examples are given to illustrate how our model also supports variants of reachability analysis: impact analysis, class visibility analysis, and dead code detection. Finally, we discuss the implementation and experience of our analysis tools on a few C++ software projects  相似文献   

7.
Model-based development (MBD) holds the promise to capture potential timing problems in embedded software during the early phases of the development, securing the production of bug-free embedded software. For most MBD approaches, the source code is just an intermediate artifact that can be generated automatically from the models. This assumption clashes with an undeniable fact: a large share of the commercial embedded software exploits existing libraries or is developed using C/C++ natively. A way to reconcile the ambitions of MBD with the use of a programming language is by offering new language constructs and an innovative compilation tool-chain that prevents model error and timing problems “by construction.” However, the persistent popularity of C/C++ among embedded programmers and the limited availability of tools have severely limited the uptake of alternative programming languages for embedded software. Therefore, we propose an original route. Our language proposal, named Tice, has been shaped as a C++ active library. Tice retains full compatibility with existing C++ code, which can be integrated easily into new Tice-based projects. The enforcement of Tice syntax and semantics can be made by a standard C++ compiler, forgoing the need for new tools. In this article, we describe Tice's syntax, semantics, and model of computation and communication. We demonstrate Tice's practical applicability on an industrial scale use-case and give ample evidence for Tice's efficient compilation using off-the-shelf C++ compilers. Finally, we show Tice's code generation process.  相似文献   

8.
Linux平台下基于源代码插装的动态内存检测   总被引:1,自引:0,他引:1  
在C/C++语言程序中.指针的使用使代码灵活、简便.但所带来的类似内存泄漏、内存写溢出等的内存使用的错误却很难分析和消除.针对这些容易出现的内存使用错误.提出了Linux平台下一种基于源文件信息提取和源代码插装的动态内存检测方法,设计实现了一个动态内存检测模块DDMEM.可以检测源代码的内存泄漏、内存写溢出、释放野指针和内存管理函数的不匹配等问题.给出了写溢出错误的一个实例检测,以验证方法的有效性.  相似文献   

9.
国产异构众核处理器是我国打破国际技术壁垒,在高性能计算领域取得突破的关键环节.围绕国产超算的软件生态环境建设,采用智能源码转换的方法盘活海量多核架构的遗产代码是加速软件研发效率,推动领域发展的重要途径.针对国产运算核心不支持C++编译的现状,基于开源的ANTLR语言翻译工具,提出了一种面向异构众核处理器的智能化C++语...  相似文献   

10.
为轻松获得程序的可能执行路径,进而实现程序变量的状态跟踪,提出了一种C/C++源代码控制流提取算法,通过该模型获取控制流切片,产生局部控制流图,将数据流异常检测与安全子集检测相结合,弥补了单独使用安全子集方法无法跟踪数据流的不足,增强代码安全隐患的挖掘能力.利用控制流图化简,排除部分不可达控制流信息,提高跟踪效率.通过对3个Linux内核源文件的检测,验证了该方法不仅可以检测出违反安全子集的代码安全隐患,同时对代码数据流异常检测提供支持,准确率达94.9%.  相似文献   

11.
Lars Engebretsen 《Software》2006,36(15):1643-1654
This paper describes some of the author's experiences from a C++ implementation of a concordance program for texts in Old West Norse (also known as Old Icelandic) and Runic Swedish. Since the input to the program used a character repertoire that no standard one‐byte character encoding covers, it was natural to use Unicode to represent data both inside the program and in external files. Inside the program, each character was represented with C++ ‘wide characters’; the input and output was represented in UTF‐8. The author constructed C++ code conversion facets that convert data between those two representations during file I/O. This enabled him to successfully compile, and run, the concordance program on both Linux (Fedora Core 3 with gcc 3.4.2) and Windows XP (using Visual C++ .NET 2003). The only necessary change to the source when changing platform was isolated to the lines selecting which code conversion facet to use—all other pieces of code remained unchanged. In particular, the author could still use the standard C++ locale framework for collation and code conversion, in spite of the fact that the library‐provided code conversion facets had been replaced. Copyright © 2006 John Wiley & Sons, Ltd.  相似文献   

12.
一种离散时间事件仿真架构及其实现   总被引:2,自引:0,他引:2  
梁景新  何晨  诸鸿文 《计算机仿真》2001,18(1):33-36,28
该文介绍了一种C++语言开发,基于消息处理的离散时间事件仿真软件架构,并且给出了关键的实现算法和C++源程序段。由于在设计中充分考虑了易用性、通用性、可扩展性和代码的兼容性,该仿真架构是很有实用价值的。  相似文献   

13.
NS-2新功能模块的开发   总被引:2,自引:0,他引:2  
网络仿真软件NS-2具有源代码公开、可扩展性强等特点,已广泛用于网络分析、研究和教学。是目前网络仿真最流行的软件之一。网络的迅速发展需要人们不断研究新的网络协议和算法以及通过仿真分析网络性能。NS-2由于其源代码开放的特点,允许用户根据实际需求添加新的协议模块并通过仿真分析协议性能,这一特性成倍加速了新协议开发过程。该文给出了在NS-2中添加新功能模块的模版——编译层实现;解释层实现;编译层与解释层的接口;对原有相关文件的修改;编译及测试。并以自组网路由协议为例,从这五个方面详细介绍了在NS-2软件中添加新模块的过程。  相似文献   

14.
This paper introduces NiHu, a C++ template library for boundary element methods (BEM). The library is capable of computing the coefficients of discretised boundary integral operators in a generic way with arbitrarily defined kernels and function spaces. NiHu’s template core defines the workflow of a general BEM algorithm independent of the specific application. The core provides expressive syntax, based on the operator notation of the BEM, reflecting the mathematics behind boundary elements in the C++ source code. The customisable Component library contains elements specific to particular applications such as different numerical integration techniques and regularisation methods. The library can be used for creating a standalone C++ application using external open source libraries, or compiling a Matlab toolbox through the MEX interface. By massively exploiting C++ template metaprogramming, NiHu generates optimised codes for specific applications, including heterogeneous problems. The paper introduces the main concepts of the novel development, demonstrates its versatility and flexibility and compares the implementation’s performance to that of other open source projects.  相似文献   

15.
Two kinds of interface contract violations can occur in component-based software: A client component can fail to satisfy a requirement of a component it is using, or a component implementation can fail to fulfill its obligations to the client. The traditional approach to detecting and reporting such violations is to embed assertion checks into component source code, with compile-time control over whether they are enabled. This works well for the original component developers, but it fails to meet the needs of component clients who do not have access to source code for such components. A wrapper-based approach, in which contract checking is not hard-coded into the underlying component but is "layered" on top of it, offers several relative advantages. It is practical and effective for C++ classes. Checking code can be distributed in binary form along with the underlying component, it can be installed or removed without requiring recompilation of either the underlying component or the client code, it can be selectively enabled or disabled by the component client on a per-component basis, and it does not require the client to have access to any special tools (which might have been used by the component developer) to support wrapper installation and control. Experimental evidence indicates that wrappers in C++ impose-modest additional overhead compared to inlining assertion checks.  相似文献   

16.
EASTT:一种嵌入式应用软件测试系统   总被引:4,自引:0,他引:4  
本文介绍了我们对嵌入式软件进行分析测试以及质量评价方面的研究成果--EASTT系统,这是一套针对C/C++语言的测试工具集,可用于对嵌入式应用软件的静态结构分析、动态测试和运行情况跟踪,并提供了一个层次化模型来对应用软件的质量进行综合评价。  相似文献   

17.
基于面向对象方法的攻击知识模型   总被引:6,自引:0,他引:6  
  相似文献   

18.
As software systems become increasingly massive, the advantages of automated transformation tools are clearly evident. These tools allow the machine to both reason about and manipulate high-level source code. They enable off-loading of mundane and laborious programming tasks from human developer to machine, thereby reducing cost and development time frames.Although there has been much work in software transformation, there still exist many hurdles in realizing this technology in a commercial domain. From our own experience, there are two significant problems that must be addressed before transformation technology can be usefully applied in a commercial setting. These are: (1) Avoiding disruption of the style (i.e., layout and commenting) of source code and the introduction of any undesired modifications that can occur as a side effect of the transformation process. (2) Correct automated handling of C preprocessing and the presentation of a semantically correct view of the program during transformation. Many existing automated transformation tools require source to be manually modified so that preprocessing constructs can be parsed. The real semantic of the program remains obscured resulting in the need for complicated analysis during transformation. Many systems also resort to pretty printing to generate transformed programs, which inherently disrupts coding style. In this paper we describe our own C/C++ transformation system, Proteus, that addresses both these issues. It has been tested on millions of lines of commercial C/C++ code and has been shown to meet the stringent criteria laid out by Lucent’s own software developers.  相似文献   

19.
Understanding detailed changes done to source code is of great importance in software maintenance. We present Code Flows, a method to visualize the evolution of source code geared to the understanding of fine and mid‐level scale changes across several file versions. We enhance an existing visual metaphor to depict software structure changes with techniques that emphasize both following unchanged code as well as detecting and highlighting important events such as code drift, splits, merges, insertions and deletions. The method is illustrated with the analysis of a real‐world C++ code system.  相似文献   

20.
异常机制是C++崭新而高级的特性,比起传统的返回错误代码的做法,异常机制能够针对各种可能的错误提供更有效的解决方法,而且可以使正常代码和错误处理清晰划分开来。关于如何安全、可靠地使用异常机制,MISCRAC++给出了一些相关的规范。  相似文献   

设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号