Say I have a short buggy script, hello.C:
double* hello(){
double *a=NULL;
std::cout << "Let's have a segfault: " << (*a) << std::endl;
return a;
}
Can someone please instruct me (or point me to a documentaion) on how to run this in gdb in ROOT (i.e. without actually compiling it)?
Thank you!
pcanal
June 6, 2011, 3:39pm
#2
Hi,
Do gdb root.exe
gdb> run
root [] .x hello.C+
Cheers,
Philippe.
Philippe, thanks! I assume I do not need to build root with -g for this to work…how about .x hello.C+, does root by default compile it with debug options?
pcanal
June 6, 2011, 5:52pm
#4
Hi,
With building ROOT debug, it will work but you will have less information about the ROOT parts.
Cheers,
Philippe.
Philippe, sorry for pestering you – just one more question…
Say I want to place a breakpoint in hello.C, right after line 2. How would I do that?