Debugging C++ Applications Using HP WDB (766162-001, March 2014)

Contents
About this document.................................................................................................................4
Intended audience....................................................................................................................4
Document conventions and symbols............................................................................................4
Terms and definitions................................................................................................................4
Related information...................................................................................................................5
HP Encourages your comments...................................................................................................5
Introduction..............................................................................................................................6
C++ Expressions supported in WDB expressions..........................................................................6
Displaying mangled or demangled names...................................................................................6
Debugging scope resolution operator..........................................................................................7
HP WDB scope resolution operator........................................................................................8
C++ scope resolution operator..............................................................................................9
Displaying class and object information.....................................................................................11
Debugging member function....................................................................................................12
Debugging inherited classes....................................................................................................14
Debugging expressions with type-casting...................................................................................16
Debugging namespaces..........................................................................................................16
Debugging inline functions......................................................................................................19
Limitations of debugging inline functions...............................................................................21
Displaying static and dynamic (Run-Time) type information...........................................................21
Debugging a virtual function....................................................................................................23
Resolving ambiguous references to overloaded functions..............................................................24
Limitations of debugging overloaded functions.......................................................................26
Catching C++ exceptions........................................................................................................26
Debugging C++ templates.......................................................................................................28
Debugging opaque type.........................................................................................................31
Debugging anonymous unions.................................................................................................32
Debugging dynamic memory related issues...............................................................................33
Debugging standard template library (STL).................................................................................34
Debugging C++11 specific features ..........................................................................................36
Debugging char16_t and char32_t Types..............................................................................36
Debugging enum class.......................................................................................................37
Debugging rvalue reference................................................................................................38
Debugging variadic template functions.................................................................................38
HP WDB commands or variables used in C++ application debugging..........................................40
Limitations of using HP WDB to debug C++ applications.............................................................41
Documentation feedback.........................................................................................................41
Index.........................................................................................................43
Contents 3