Message: how to use gdb and make file Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None how to use gdb and make file 

Keywords: gdb and make
Forum: Run Management
Date: 08 Oct, 2006
From: <jgzm6@umr.edu>

Hi, Masters
any one can help me would be very appreciated. I build a short code based
on the novice exampleN01. after makeing files successfulty I try to run it
, it abort with some error. then I debug it by using gdb. my command is:

______________________________________________________________
jgao@RO-20989 ~/Geant4/g4work/project1
$ make
Making dependency for file exampleN01.cc ...
Making dependency for file src/ExN01PrimaryGeneratorAction.cc ...
Making dependency for file src/ExN01PhysicsList.cc ...
Making dependency for file src/ExN01DetectorConstruction.cc ...
Compiling ExN01DetectorConstruction.cc ...
ExN01DetectorConstruction.cc
Compiling ExN01PhysicsList.cc ...
ExN01PhysicsList.cc
Compiling ExN01PrimaryGeneratorAction.cc ...
ExN01PrimaryGeneratorAction.cc
Creating/replacing object files in c:/Geant4/g4work/tmp/WIN32-VC/exampleN01/libe
xampleN01.a ...
Microsoft (R) Library Manager Version 7.10.3077
Copyright (C) Microsoft Corporation.  All rights reserved.

Compiling exampleN01.cc ...
exampleN01.cc
Using granular libraries ...
Linking exampleN01 ...
... Done!

jgao@RO-20989 ~/Geant4/g4work/project1
$ ./exampleN01

*************************************************************
 Geant4 version Name: geant4-08-01-patch-01    (27-July-2006)
                      Copyright : Geant4 Collaboration
                      Reference : NIM A 506 (2003), 250-303
                            WWW : http://cern.ch/geant4
*************************************************************


jgao@RO-20989 ~/Geant4/g4work/project1
$ gdb exampleN01
GNU gdb 6.5.50.20060706-cvs (cygwin-special)
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-cygwin"...(no debugging symbols found)

(gdb) backtrace
No stack.
(gdb) run
Starting program: /cygdrive/c/Geant4/g4work/project1/exampleN01.exe
Loaded symbols for /cygdrive/c/WINDOWS/system32/ntdll.dll
Loaded symbols for /cygdrive/c/WINDOWS/system32/kernel32.dll
Loaded symbols for /cygdrive/c/WINDOWS/system32/msvcp71.dll
Loaded symbols for /cygdrive/c/WINDOWS/system32/msvcr71.dll

*************************************************************
 Geant4 version Name: geant4-08-01-patch-01    (27-July-2006)
                      Copyright : Geant4 Collaboration
                      Reference : NIM A 506 (2003), 250-303
                            WWW : http://cern.ch/geant4
*************************************************************


Program received signal SIGSEGV, Segmentation fault.
0x00409896 in ?? ()
(gdb) backtrace
#0  0x00409896 in ?? ()
#1  0xffffffff in ?? ()
#2  0x00656f40 in ?? ()
#3  0x0040a638 in ?? ()
#4  0x0068d100 in ?? ()
#5  0x006369c0 in ?? ()
#6  0x00636940 in ?? ()
#7  0x0012ffc0 in ?? ()
#8  0xffffffff in ?? ()
#9  0x01330000 in ?? ()
#10 0x006804a4 in ?? ()
#11 0x00000008 in ?? ()
#12 0xff9db400 in ?? ()
#13 0x00661d88 in ?? ()
#14 0x00000000 in ?? ()
(gdb)

_________________________________________________________________________

Is this the right way to use "gdb" and "make", But from internet it is 
said that we have to compile the file with -g flag and then link. does 
"make" did that for us already?

thank you!

Gao

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

 Add Message Add Message
to: "how to use gdb and make file"

 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 ]