Re: [ROOT] debugging ROOT with gdb

From: Rene Brun (Rene.Brun@cern.ch)
Date: Tue Jun 04 2002 - 10:04:03 MEST


Hi Brett, David,

A simple alternative is simply to set gDebug=5 in your script
or command line

Rene Brun



Brett Viren wrote:
> 
> David Faden writes:
>  > Hi,
>  >    Is there an online guide to debugging ROOT apps with gdb?
>  > Specifically, I'm wondering if someone could explain in more detail these
>  > directions given in by Fons Rademaker in an August 14, 2001 Roottalk message:
>  >
>  > You need to run ROOT in synchronous mode in the debugger and set a breakpoint
>  > in RootX11ErrorHandler to see which X11 object causes the problem (set
>  > debug=5
>  > in .rootrc to run in X11 sunc mode).
>  > I think the above directions could be useful in figuring out a problem
>  > that's been puzzling me. I have added the following line to my .rootrc file:
>  > debug: 5
>  > Is this correct?
> 
> It might need to be:
> 
>         Unix.*.Root.debug: 5
> 
> But, I'm not sure.
> 
>  >    I have not figured out how to set a break point in RootX11ErrorHandler.
>  > gdb seems not to be aware of it. Would I need to recompile the ROOT
>  > libraries for gdb to be able to find it?
> 
> Yes, very much so.  Set environment variable ROOTBUILD=debug do a
> "make clean ; make".
> 
> Other things that may help:
> 
>  - run and attach GDB to root.exe, not the usual "root" executable
>  (some fancy fork/exec goes on in "root" to quickly parse cmd. line
>  args and give the illusion of fast startup).
> 
>  - run GDB 5.x for better C++ support.  v4 is pretty bad with C++.
> 
>  - set a break in main(), hit it, set the break you really want and
>  then "continue".  This gets around spurious "can not do i/o"
>  (message paraphrased) GDB error.
> 
> It would be nice to collect all these things in the root manual (maybe
> they are there, I haven't looked recently).
> 
> Luck,
> -Brett.



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:54 MET