Re: can't set breakpoint at TFile::TFile() in gdb

From: Fons Rademakers <Fons.Rademakers_at_cern.ch>
Date: Tue, 30 Oct 2007 12:40:09 +0100


In general gdb is pretty bad with handling C++ code and especially C++ code in shared libraries. On the Mac Apple has done their best to make gdb play nicer with C++. For real debugging get TotalView.

Cheers, Fons.

Tobias Raufer wrote:
> The message below doesn't seem to have gone through the first time.
> Apologies if you receive this twice.
>
> Tobi
>
>
> Dear Roottalk,
>
> I am encountering a problem during debugging some code which uses ROOT
> classes in gdb.
>
> First of all, I am using root v5-14-00 on Scientific Linux 5.0. I am
> debugging an executable which uses some ROOT classes like for example
> TFile. It was built using the -g flag for debugging symbols as was ROOT.
>
> I would like to set a breakpoint at the TFile constructor. I am doing
>
> (gdb) b 'TFile::TFile(char const*, char const*, char const*, int)'
> Breakpoint 6 at 0x20e9ea1a: file include/TVirtualMutex.h, line 77
>
> It sets the breakpoint in TVirtualMutex.h instead of TFile.h.
> Consequently, when running the program, the debugger never stops at the
> intended breakpoint. I know for a fact that the above constructor is
> called by the program.
>
> I assume this has something to do with thread support in ROOT. Is there
> any way I can set a breakpoint at the intended place?
>
> Sorry if this is a stupid question. I am not very experienced in using gdb.
>
> Cheers,
> Tobi
>
> ---
> Dr Tobias Raufer
>
> R1,2.90, RAL
> Chilton, Didcot
> OX11 0QX, UK
> +44 1235 778842
> +44 1235 446733 (fax)
> t.m.raufer_at_rl.ac.uk
>

-- 
Org:    CERN, European Laboratory for Particle Physics.
Mail:   1211 Geneve 23, Switzerland
E-Mail: Fons.Rademakers_at_cern.ch              Phone: +41 22 7679248
WWW:    http://fons.rademakers.org           Fax:   +41 22 7669640
Received on Tue Oct 30 2007 - 12:41:18 CET

This archive was generated by hypermail 2.2.0 : Tue Oct 30 2007 - 17:50:02 CET