This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gdb: lose of stack frames or function name missing


Hello,

The best thing to do first is to download a more recent GDB (see
http://sources.redhat.com/gdb/current/ ).  If this problem is still
occuring then consider submitting a bug report.

Andrew

> Hi, there:
> 
> Thank you in advance for your help.  
> 
> I am using gdb to debug my C++ program, which contains a lot of
> template classes.
> 
> This is how I compiled and linked:
> g++ -c -ggdb myProg.cc
> g++ -o myProg myProg.o
> 
> When I run myProg, I got a core dump and I intended to use gdb to
> debug.
> 
> I used two Unix systems.
> 
> System 1: gdb version 5.0, g++ version 3.0.2.  
>    In this system, after loading the core using "gdb myProg core", I
> issued gdb command "where".
> 
>    The following is what I get
>    (gdb) where
>    #0  0xef65c840 in _libc_kill () from /usr/lib/libc.so.1
>    #1  0xef5f5ab4 in abort () from /usr/lib/libc.so.1
>    #2  0x13da0 in Letext ()
> 
>    It appeared that function where core dumped is not in the frame
> stack.  The frames listed here are just from linked libraries.
> 
> Q1:  Is there any way to include the functions from main to which the
> core is dumped in the stack frame?
> 
> System 2: gdb version 4.17, g++ version 2.95.3.  
>    In this system, after loading the core using "gdb myProg core", I
> issued gdb command "where".
>    The following is what I get
>    (gdb) where
>    #0  0xef65c840 in ?? ()
>    #1  0x13da0 in ?? ()
>    #2  0x157b0 in ?? ()
>    #3  0x14284 in ?? ()
>    #4  0x14644 in ?? ()
>    #5  0x13a2c in ?? ()
>    
>    It appeared that functions where core dumped upto the main are
> included in the frame stack.  However all the function names are
> garbled.
>    I set the following variables in gdb
>       set demangle-style gnu
>       set print asm-demangle on
>       set print demangle on
> 
>    Function names are still garbled.
> 
> Q2:  Is there any way to have the function name being listed?  
> 
> I am a novice on gdb. I do not have .gdbinit, may be one would solve
> all the problems above?
> 
> Q3:  Where can I get a "standard" .gdbinit?
> 
> To be honest, I am enthusiastic in using gdb and I have spent quite a
> lot of time in reading tutorials.  I hope I can use it doing my
> debugging routine.  However, I tried a dbx debugging session and the
> complete fram stack can be printed out with function names (below).
> 
> I am convinced that I must have done something wrong in using gdb. 
> Please give me your kind advise.
> 
> Thank you very much.
> 
> Alex
> 
> PS:
> The frame stack from dbx debugging session looks like:
> 
> (/opt/SUNWspro/bin/../WS6U2/bin/sparcv9/dbx) where
>   [1] _kill(0x0, 0x6, 0x0, 0xffffffff, 0xff2bc414, 0xff2356d8), at
> 0xff29bb54
>   [2] abort(0xff2b8018, 0xffbef260, 0x2f, 0x7efefeff, 0x81010100,
> 0xff00), at 0x
> ff2357bc
>   [3] _assert(0x4c1d2, 0x4c1d7, 0x21, 0x4c1d7, 0x2198c, 0x3d6d0), at
> 0xff235a60
> =>[4] SortedList<int>::SortedList(this = 0xffbef650, init = CLASS),
> line 33 in "
> slist.cc"
>   [5] Set<int>::Set(this = 0xffbef650, init = CLASS), line 18 in
> "set.cc"
>   [6] Set<int>::intersection(this = 0xffbef688, s = CLASS), line 113
> in "set.cc"
>   [7] main(), line 77 in "testSet_long.cc"
> 
> _______________________________________________
> Bug-gdb mailing list
> Bug-gdb@gnu.org
> http://mail.gnu.org/mailman/listinfo/bug-gdb
> 



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]