Debugging

Transformations to solve debugging complexities

on May 30, 17 • by Dean Stewart • with No Comments

Applications keep adding more complex functionality but development timeframes and resources are as short as ever. So how can you solve the data and call stack abstractions...

Home » Dynamic analysis » Transformations to solve debugging complexities

Applications keep adding more complex functionality but development timeframes and resources are as short as ever. To account for this, programming languages and frameworks have added abstraction layers (lambda functions, STL, Boost, application middleware). These abstractions make debugging harder because developers need to look through indirect pointers to their actual data and the stack frames get filled with glue code so they lose their place while debugging.

TotalView for HPC and CodeDynamics, leading multithreaded debuggers, includes a type transformation framework (TTF), and stack transformation framework (STF), which help solve the data and call stack abstractions respectively.

Type transformation framework

TotalView and CodeDynamics provide the ability for developers to define how they view their aggregate data, in classes or structures. By default, TotalView and CodeDynamics use the TTF to transform STL strings, vectors, lists, maps, multimaps, sets, and multisets, as well as the unordered STL types for recent g++ compilers.

TTF allows developers to focus on the data elements of interest and not unnecessary detail provided by the compiler. By using TTF, developers can create a transformation to show only some of the class or structure and hide the rest from view, thus simplifying the process of debugging. The transformation can be loaded from a file or applied automatically to every TotalView and CodeDynamics debugging session.

Figure 1: TTF transformation to show only the year, name, and street fields from the structure

Stack transformation framework

TotalView 2017.1 and CodeDynamics 2017.1 add the ability to transform the Call Stack. The Stack Transformation Facility maintains a list of rules that modify the displayed stack frames.

Using the STF, it’s possible to create a set of rules to filter out unwanted stack frames, allowing the user to focus only on those stack frames that are of interest. This can greatly simplify and enhance the debugging process for complex applications.

TotalView and CodeDynamics use the STF to filter out glue code in our new mixed language (Python and C/C++) support. For more details on the mixed language support, read this white paper.

As a simple example, the following (Figure 2) shows a rule is added to filter out the function named ‘_start’ from the stack trace view.

Figure 2: Command line view showing the stack trace before and after the STF rule is applied

The effect of adding this rule can also be seen in the Call Stack window (Figure 3 and Figure 4) where the function named ‘_start’ is removed from view.

Using TTF and STF gives developers an unprecedented level of control over how they view their data and functions. These powerful features of TotalView and CodeDynamics are available to help transform the debugging experience and simplify complex tasks.

For more details about our dynamic analysis products, visit our website.

Figure 3 (left): Call Stack before STF rule is applied
Figure 4 (right): Call Stack after STF rule is applied

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to top