Konferensartikel

Static and Dynamic Debugging of Modelica Models

Adrian Pop
Programming Environments Laboratory, Department of Computer and Information Science, Linköping University, Linköping, Sweden

Martin Sjölund
Programming Environments Laboratory, Department of Computer and Information Science, Linköping University, Linköping, Sweden

Adeel Asghar
Programming Environments Laboratory, Department of Computer and Information Science, Linköping University, Linköping, Sweden

Peter Fritzson
Programming Environments Laboratory, Department of Computer and Information Science, Linköping University, Linköping, Sweden

Francesco Casella
Dipartimento di Elettronica e Informazione, Politecnico di Milano, Milano, Italy

Ladda ner artikelhttp://dx.doi.org/10.3384/ecp12076443

Ingår i: Proceedings of the 9th International MODELICA Conference; September 3-5; 2012; Munich; Germany

Linköping Electronic Conference Proceedings 63:46, s. 443-454

Visa mer +

Publicerad: 2012-11-19

ISBN: 978-91-7519-826-2

ISSN: 1650-3686 (tryckt), 1650-3740 (online)

Abstract

The high abstraction level of equation-based object-oriented languages (EOO) such as Modelica has the drawback that programming and modeling errors are often hard to find. In this paper we present static and dynamic debugging methods for Modelica models and a debugger prototype that addresses several of those problems. The goal is an integrated debugging framework that combines classical debugging techniques with special techniques for equation-based languages partly based on graph visualization and interaction. The static transformational debugging functionality addresses the problem that model compilers are optimized so heavily that it is hard to tell the origin of an equation during runtime. This work proposes and implements a prototype of a method that is efficient with less than one percent overhead; yet manages to keep track of all the transformations/operations that the compiler performs on the model. Modelica models often contain functions and algorithm sections with algorithmic code. The fraction of algorithmic code is increasing since Modelica; in addition to equation-based modeling; is also used for embedded system control code as well as symbolic model transformations in applications using the MetaModelica language extension. Our earlier work in debuggers for the algorithmic subset of Modelica used high-level code instrumentation techniques which are portable but turned out to have too much overhead for large applications. The new dynamic algorithmic code debugger is the first Modelica debugger that can operate without high-level code instrumentation. Instead; it communicates with a low-level C-language symbolic debugger to directly extract information from a running executable; set and remove breakpoints; etc. This is made possible by the new bootstrapped OpenModelica compiler which keeps track of a detailed mapping from the high level Modelica code down to the generated C code compiled to machine code. The dynamic algorithmic code debugger is operational; supports both standard Modelica data structures and tree/list data structures; and operates efficiently on large applications such as the OpenModelica compiler with more than 100 000 lines of code. Moreover; an integrated debugging approach is proposed that combines static and dynamic debugging.

To our knowledge; this is the first Modelica debugger that supports both transformational and algorithmic code debugging.

Nyckelord

Modelica; Debugging; Modeling and Simulation; Transformations; Equations; Algorithmic Code; Eclipse

Referenser

Inga referenser tillgängliga

Citeringar i Crossref