Message: RE: gdb debug Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None RE: gdb debug 

Forum: Event and Track Management
Re: Question gdb debug (wangym)
Re: Idea Re: gdb debug (wangym)
Re: Question Re: gdb debug (wangym)
Date: 15 Nov, 2009
From: Robert Penny <Robert Penny>

This is a multi-part message in MIME format.

------_=_NextPart_001_01CA663A.0DB500C2
Content-Type: text/plain;
 charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi,

(Firstly, I'm sorry if this response should more appropriately be in the =
"installation" topic section.)

If I'm understanding you correctly, you're saying that you've compiled =
the sample codes with debugging turned on, but can only list and single =
step through CLHEP and example code sections, but not list and single =
step code actually in the Geant4 library.  Right? =20

If so, this is exactly the behaviour you'd expect.

Geant is typically installed as a set of compiled, shared libraries.  =
When you compile your own application, typically you are only freshly =
compiling the application code.  If you turn on the debugging flag for a =
debugging compilation, it is only the freshly compiled code that are =
compiled with debugging information included.  The Geant libraries are =
NOT recompiled at this stage.  When you run the application, the dynamic =
linking loader links to the Geant shared libraries that were compiled at =
the time that Geant itself was installed.  (Compiling Geant takes =
approximately an hour.)

You can only use gdb to list and single step through the sections of the =
code that have been compiled with debugging turned on.  The debug flag =
in the compilation leaves embedded debugging and symbol information in =
the code that gdb then uses.  Unless the Geant libraries have also been =
compiled and installed with debugging turned on, you won't be able to =
single step through or list these sections of the code.

I don't know what platform you are running on.  On my Gentoo Linux =
distribution I installed Geant twice.  The first time I compiled and =
installed the code with debugging turned on.  I then renamed the =
installed /usr/lib/geant4 library directory to /usr/lib/geant4_debug.  I =
then recompiled and installed Geant with debugging turned off.  I then =
renamed the library from /usr/lib/geant4 to /usr/lib/geant4_nodebug.  =
(My "nodebug" version of the libraries take about 54 MB of disk space.  =
I don't have access to the machine with the debug compilation on it at =
the moment (it's at work), but the libraries take a lot more disk space; =
ten times more if I'm remembering correctly.) =20

To select which library I link to, I created a symbolic link of =
/usr/lib/geant4_nodebug -> /usr/lib/geant4 and typically compile and run =
applications this way.  If I need to debug into the Geant library, I =
delete the symbolic link, create a new link pointing to the debugging =
libraries, then recompile the code and run this way.  This allows me to =
debug all the way through into the Geant4 library code.

There is probably a more elegant way of doing this, by changing some =
environment variable specifying the path to the Geant4 library that you =
want to link to.

The reason you can list and step through the CLHEP sections (or at least =
some of them) is that a lot of CLHEP is actually just pulled in through =
include files.  When a file is included in an include statement, the =
code that has been included is also compiled.  So, these sections WILL =
have debugging information in them, because you have freshly compiled =
them with debugging turned on.

-Rob Penny.  (robert.d.penny at SAIC dot com)

p.s.  For anyone actually wanting to install Geant on a Gentoo platform =
with debugging information using the package manager, there is a trick =
to it.  There is a "use" flag for turning on debug compilation in the =
Gentoo Geant package, but the installer just prior to installing the =
compiled libraries, will be default strip all of the debugging symbols =
back out.  You need to defeat this behaviour by doing something like =
"FEATURES=3Dnostrip emerge --deep geant".

-----Original Message-----
From: douglas@slac.stanford.edu on behalf of wangym
Sent: Sat 11/14/2009 7:25 PM
To: eventtrackmanage-g4hn@slac.stanford.edu
Subject: Re: gdb debug
=20

*** Discussion title: Event and Track Management

sorry,example can see.CLHEP can see.But Geant4 library can not see.

-------------------------------------------------------------
Visit this GEANT4 at hypernews.slac.stanford.edu message (to reply or =
unsubscribe) at:=20
http://hypernews.slac.stanford.edu/HyperNews/geant4/get/eventtrackmanage/=
898/1/1.html=20






------_=_NextPart_001_01CA663A.0DB500C2
Content-Type: text/html;
 charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
6.5.7655.4">
<TITLE>RE: gdb debug</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

<P><FONT SIZE=3D2>Hi,<BR>
<BR>
(Firstly, I'm sorry if this response should more appropriately be in the =
&quot;installation&quot; topic section.)<BR>
<BR>
If I'm understanding you correctly, you're saying that you've compiled =
the sample codes with debugging turned on, but can only list and single =
step through CLHEP and example code sections, but not list and single =
step code actually in the Geant4 library.&nbsp; Right?&nbsp;<BR>
<BR>
If so, this is exactly the behaviour you'd expect.<BR>
<BR>
Geant is typically installed as a set of compiled, shared =
libraries.&nbsp; When you compile your own application, typically you =
are only freshly compiling the application code.&nbsp; If you turn on =
the debugging flag for a debugging compilation, it is only the freshly =
compiled code that are compiled with debugging information =
included.&nbsp; The Geant libraries are NOT recompiled at this =
stage.&nbsp; When you run the application, the dynamic linking loader =
links to the Geant shared libraries that were compiled at the time that =
Geant itself was installed.&nbsp; (Compiling Geant takes approximately =
an hour.)<BR>
<BR>
You can only use gdb to list and single step through the sections of the =
code that have been compiled with debugging turned on.&nbsp; The debug =
flag in the compilation leaves embedded debugging and symbol information =
in the code that gdb then uses.&nbsp; Unless the Geant libraries have =
also been compiled and installed with debugging turned on, you won't be =
able to single step through or list these sections of the code.<BR>
<BR>
I don't know what platform you are running on.&nbsp; On my Gentoo Linux =
distribution I installed Geant twice.&nbsp; The first time I compiled =
and installed the code with debugging turned on.&nbsp; I then renamed =
the installed /usr/lib/geant4 library directory to =
/usr/lib/geant4_debug.&nbsp; I then recompiled and installed Geant with =
debugging turned off.&nbsp; I then renamed the library from =
/usr/lib/geant4 to /usr/lib/geant4_nodebug.&nbsp; (My =
&quot;nodebug&quot; version of the libraries take about 54 MB of disk =
space.&nbsp; I don't have access to the machine with the debug =
compilation on it at the moment (it's at work), but the libraries take a =
lot more disk space; ten times more if I'm remembering =
correctly.)&nbsp;<BR>
<BR>
To select which library I link to, I created a symbolic link of =
/usr/lib/geant4_nodebug -&gt; /usr/lib/geant4 and typically compile and =
run applications this way.&nbsp; If I need to debug into the Geant =
library, I delete the symbolic link, create a new link pointing to the =
debugging libraries, then recompile the code and run this way.&nbsp; =
This allows me to debug all the way through into the Geant4 library =
code.<BR>
<BR>
There is probably a more elegant way of doing this, by changing some =
environment variable specifying the path to the Geant4 library that you =
want to link to.<BR>
<BR>
The reason you can list and step through the CLHEP sections (or at least =
some of them) is that a lot of CLHEP is actually just pulled in through =
include files.&nbsp; When a file is included in an include statement, =
the code that has been included is also compiled.&nbsp; So, these =
sections WILL have debugging information in them, because you have =
freshly compiled them with debugging turned on.<BR>
<BR>
-Rob Penny.&nbsp; (robert.d.penny at SAIC dot com)<BR>
<BR>
p.s.&nbsp; For anyone actually wanting to install Geant on a Gentoo =
platform with debugging information using the package manager, there is =
a trick to it.&nbsp; There is a &quot;use&quot; flag for turning on =
debug compilation in the Gentoo Geant package, but the installer just =
prior to installing the compiled libraries, will be default strip all of =
the debugging symbols back out.&nbsp; You need to defeat this behaviour =
by doing something like &quot;FEATURES=3Dnostrip emerge --deep =
geant&quot;.<BR>
<BR>
-----Original Message-----<BR>
From: douglas@slac.stanford.edu on behalf of wangym<BR>
Sent: Sat 11/14/2009 7:25 PM<BR>
To: eventtrackmanage-g4hn@slac.stanford.edu<BR>
Subject: Re: gdb debug<BR>
<BR>
<BR>
*** Discussion title: Event and Track Management<BR>
<BR>
sorry,example can see.CLHEP can see.But Geant4 library can not see.<BR>
<BR>
-------------------------------------------------------------<BR>
Visit this GEANT4 at hypernews.slac.stanford.edu message (to reply or =
unsubscribe) at:<BR>
<A =
HREF=3D"http://hypernews.slac.stanford.edu/HyperNews/geant4/get/eventtrac=
kmanage/898/1/1.html">http://hypernews.slac.stanford.edu/HyperNews/geant4=
/get/eventtrackmanage/898/1/1.html</A><BR>
<BR>
<BR>
<BR>
<BR>
<BR>
</FONT>
</P>

</BODY>
</HTML>
------_=_NextPart_001_01CA663A.0DB500C2--

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 Question: Re: RE: gdb debug   (wangym - 16 Nov, 2009)
(_ Question: Re: RE: gdb debug   (wangym - 16 Nov, 2009)
(_ Question: Re: RE: gdb debug   (wangym - 16 Nov, 2009)
(_ Idea: Re: RE: gdb debug   (wangym - 16 Nov, 2009)
 Add Message Add Message
to: "RE: gdb debug"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]