Debugging a compiled class

For example, if I create a class contained in the file TClass.C, how do I debug it after compiling with: .L TClass.C+ ? I tried to use .f to load the source and put breakpoints, but dont work.

You may say to I just load it with: .L TClass.C (without compiling). I’ve tried and this seems not to work, root crashes at the constructor. In this mode, root cannot find the data inside the class, and even cant recognize its methods.

Thank you,
G

Hi,

You need to use a C++ debugger (since the code is compiled).
For example:
gdb root.exe
gdb> run

Cheers,
Philippe.

Sorry, I see this is a begginer question, but let’s go:

Compile: .L TClass.C+g (with debugging symbols)
gdb root.exe

now, before running root, i need to tell gdb that i want to debug the TClass_C.so in line x from TClass.C. I have tried to do a file TClass_C.so, but using run now tries to run that lib and no more root.

how do I run root inside gdb telling it that i want a break in line x, from TClass.C?

Thanks,
G

gdb root.exe gdb> run root [] .L TClass.C+g <press CTRL+C> gdb> break TClass::Func or gdb> break TClass.C:123 gdb> cont root []

Cheers,
Philippe

worked fine, thank you!