Back to top

Advanced stepping functions

Step to the target of functional objects

When performing step into command at the point of call to functional objects such as std::function, SLDB jumps directly into the target of functional object, stepping through the code from the standard library.

As shown in the example, SLDB steps directly to the target of the std::bind result and back, skipping all auxilary code from the standard library.


Skip standard functions

When performing step into and step out commands, SLDB detects and skips functions from the standard library, stepping only into functions defined in user code.

As shown in the example, SLDB skips v.begin() and v.end() calls, and steps directly into the process function.


Customize step behavior

You can customize the lists of regular expressions that SLDB uses to detect the standard library functions when performing step commands. This feature allows you to apply advanced SLDB stepping functionality with third party libraries and user-defined functional objects.

The example demonstrates stepping though user defined my_functor functional object. To make it work you need just add ^my_functor::* regular expression into step settings.

Debugging functional style programs

Display values of lambda expressions

SLDB has builtin support of displaying the values of lambda expressions. You can see not only the values of captured variables, but also the name of target lambda expression.

The example shows displaying of user defined lambda expression assigned to the lambda variable.

You can navigate to position in the source code where the lambda function is defined using the Go to value definition command.

int z;
auto lambda = [z](int x, int y) -> auto {
    return x + y + z;
};

auto res = lambda(10, 20);

Display values of the standard functional objects

SLDB can display the values of the standard functional objects and related classes such as results of the std::bind function. For a result of the std::bind call, SLDB displays not only the target function, but also bound arguments and placeholders.

The example shows displaying of result of the std:bind call wrapped into the std::function object.

You can navigate to position in the source code where the target function is defined using the Go to value definition command.

void foo(int x, int y) {
    ...
}

std::function<void(int)> bf = std::bind(&foo, _1, 10);
bf(20);

Full support of libstdc++ and libc++ standard libraries

SLDB can display values of the following types from the standard libstdc++ and libc++ libraries.
Strings Simple containers Associative containers Valarray Functional Smart pointers Utility
string
string_view
wstring
wstring_view
vector
list
array
bitset
deque
queue
stack
forward_list
bitset
set
multiset
map
multimap
unordered_set
unordered_multiset
unordered_map
unordered_multimap
valarray
slice
slice_array
function
bind
placeholders
shared_ptr
unique_ptr
auto_ptr
complex
tuple
any
variant
optional

Other features

Android debugging

SLDB supports debugging on local Android device or emulator via the android platform plugin. You just need to select the android platform and specify application ID and activity name to launch. See more details in the Android debugging section in the documentation.

Integrated debugger command line

SLDB allows you to access LLDB debugger command line. All command line functions are completely integrated into the graphical interface, so all changes made from the command line (for example, adding a breakpoint), are correctly displayed in the graphical interface.

Customizable user friendly graphical interface

SLDB implements dockable graphical interface. You can move all panels to preferred locations and hide unused panels, customizing interface for your screen size and specific needs.

Syntax highlighting

SLDB has simple syntax highlighting that helps you to read and understand source code of the program being debugged.