1. Debugging Functions And Capabilities In System Software
  2. Debugging Functions And Capabilities In System Software Ppt

Anindya Dutta and Tridib RoychowdhuryJune 01, 2009One of the challenges in real'time systems, especially in multitaskingOS based implementations, is defect fixing. To resolve the defect onehas to be aware of the program flow during the defect or faultycondition. Normally, this is done by using in-circuit emulators (ICE)along with the break point feature available in the environment of theemulator.However, the ICE support may not always be available for the systemunder consideration. Considering the case that ICE is available for thesystem under consideration, and the ICE hits a breakpoint, then thedynamics of the system is lost.All the interactions the system was having with some networks orother systems/modules are stopped at once. Therefore it again may bedifficult to reproduce the defect or anomaly exactly. Though some makesof ICE provides a feature of real-time trace function, but that is alsolimited by the ICE memory.At times it is required to stop the system in some logical trigger,so that the condition of the system can be analyzed at that point. Thisfeature is also not common in normal debugging systems.Finally some development systems from WindRiver, tools like WindViewoffer powerful debugging mechanism.

System

This mechanism allows user to trackcode flow and task/interrupt scheduler switching in a GUI basedinterface. However, the development system should have support fordeploying this debugging feature.The method that we propose in this article overcomes numerous suchproblems with no extra investments. This requires some amount of freememory on board for both code/data and substantial amount of processingcapability.The function trace re-useablecomponentThe method we have developed can be applied to debug thesoftware/firmware of any type of real-time system and is named as'Function Trace' (FT).In this method, all the functions in the program are uniquely codedand as the function is executed the unique code is noted. These valuesare stored in a circular array in round-robin fashion.

This is calledas function code logging. The array contains the program flowinformation which can be used for debugging purposes.The basic requirement of employing this method is to have moderatespeed processor with some free memory.

Thus 32-bit processors are thebest choice for applying this method of debugging. Depending on theprocessor speed this debugging method may be looked upon as an overhead for low speed / low end systems.The tracking capability of the functions executed in the systemmakes it best suitable for both OS based multi-thread system and aswell as OS less systems. Function Trace can also be deployed inmultiple locations within a given function to figure out about theprogram flow within a function just as we might use it for program flowwithin a module / thread / task.Function Trace can also be added on with time stamp provided thesystem considered has a counter or a Real Time Clock on board.

Thisenables us to figure out not only the program flow but also the timetaken in various functions / modules within the system.One of the important feature of this debugging method is that itallows the user to trace only the function(s) which they intended totrace. Therefore this mechanism eliminates tracing functions which arenot required, resulting into optimal usage of memory for storage oftracing data.

Debugging Functions And Capabilities In System Software

Software

Therefore this helps the developer to focus on therequired sections of the code.Function Trace's basic operating principlesThe Function Trace feature ( Figure 1 below) creates an executionlog of every function call defined in the application firmware. As anyapplication-defined function is called, an entry for the currenttask/interrupt context (for multi-tasking system) and function calledis generated in the log with the help of a unique 32-bit identifiercode.Figure1: The Concept of Function TraceThe identifier can be generated by concatenating a function code andfile code, where the function is defined.To control the logging of function trace better, the functions canbe divided into various levels thus allowing the control of executionflow log. The entire application might be, for example, divided intonumerous small applications. The smaller applications might be dividedinto modules and further into units.Thus one might think of tracing at the module level functions, somemight think of module level or unit level functions for zooming intothe problem area. To implement this control, a function level flag isused. All the functions are categorized into some levels.

Debugging Functions And Capabilities In System Software Ppt

Based on theflag (set/ reset) the function will be logged to the trace for a givenlevel.The logged data shall be stored in RAM within the embedded system,therefore the user of this method has to plan a way to retrieve thefunction trace data through communication ports or ICE connectivity orany other method suitable for the system under debug. After the data isextracted, further analysis can be done upon the sequence of executionof the code during the faulty condition.