178x Filetype PDF File size 0.31 MB Source: www2.lauterbach.com
Application Note C++ Debugging Release 09.2022 MANUAL Application Note C++ Debugging TRACE32 Online Help TRACE32 Directory TRACE32 Index TRACE32 Documents ...................................................................................................................... High-Level Language Debugging ................................................................................................ Application Note C++ Debugging ............................................................................................. 1 Sample Code used by This Application Note ....................................................................... 3 Gathering Information of Objects .......................................................................................... 4 Display Options Dedicated to Objects 4 Most Derived Class 6 Lifetime of the “this” Pointer 6 Class Conversions 7 Gathering Information of Classes .......................................................................................... 8 C++ Overloading and Symbol Mangling ............................................................................... 9 Demangling 9 Ambiguous Symbols 9 Other Command Line Hints 10 ELF Loader Options ................................................................................................................ 11 Debugging in C++ Code .......................................................................................................... 12 Target Order / Source Order 12 Breakpoints 13 ©1989-2022 Lauterbach Application Note C++ Debugging | 2 Application Note C++ Debugging Version 26-Oct-2022 This application note describes dedicated TRACE32 PowerView commands and approaches that can be helpful when C++ applications are analyzed. Sample Code used by This Application Note Further chapters will contain pictures, commands and source code that are based to a small sample. This sample code implements two classes A and B, where B is derived UML Class from A. Diagram A Class A na1 : int na1 : int class A { A () public: A (a1 : int, a2 : int) Sum () : int int na1; ~A () int na2; A(){na1 = 1; na2 = 2;} A(int a1, int a2){na1 = a1; na2 = a2;} B virtual int Sum() { nb1 : int return na1 + na2; nb2 : int } B () virtual ~A(){;} Sum () : int }; ~B () Class B class B: public A { public: int nb1; int nb2; B(){nb1 = 3; nb2 = 4;} virtual int Sum() { return A::Sum()+nb1+nb2; } virtual ~B(){;} }; ©1989-2022 Lauterbach Application Note C++ Debugging | 3 Gathering Information of Objects Display Options Dedicated to Objects The Var.Watch or Var.View command can show the content of instances of structures or classes. The command SETUP.Var or the context menu entry Format will open a dialog with various display settings. The Inherited check box controls whether anything is displayed from the base classes. To show all known methods of the class, the Methods check box must be turned on. The integer number after a method indicates the index of that method within the Virtual Function Table. ©1989-2022 Lauterbach Application Note C++ Debugging | 4
no reviews yet
Please Login to review.