Article View: gnu.gdb.bug
Article #2404gdb: lose of stack frames or function name missing
From: Alex Cicco
Date: Sat, 30 Mar 2002 05:41
Date: Sat, 30 Mar 2002 05:41
92 lines
4012 bytes
4012 bytes
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"
Technical Details
Message-ID:
<e1bfe6a0.0203292141.249435ba@posting.google.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.uchicago.edu!news-xfer.newsread.com!netaxs.com!newsread.com!nntp.abs.net!uunet!dca.uu.net!ash.uu.net!spool0901.news.uu.net!wendy-fate.uu.net!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f5053,59ce8dcc9dfcec6d,start X-Google-Attributes: gidf5053,public X-Google-ArrivalTime: 2002-03-29 21:41:44 PST x-uunet-gateway: mr1.ash.ops.us.uu.net from bug-gdb to gnu.gdb.bug; Sat, 30 Mar 2002 05:41:42 GMT Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.uchicago.edu!news-xfer.newsread.com!netaxs.com!newsread.com!nntp.abs.net!uunet!dca.uu.net!ash.uu.net!spool0901.news.uu.net!wendy-fate.uu.net!not-for-mail From: lluum@yahoo.com (Alex Cicco) Subject: gdb: lose of stack frames or function name missing Date: 29 Mar 2002 21:41:37 -0800 Organization: http://groups.google.com/ Message-ID: <e1bfe6a0.0203292141.249435ba@posting.google.com> NNTP-Posting-Host: 63.254.12.159 Content-Type: text/plain; charset=GB2312 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1017466897 10127 127.0.0.1 (30 Mar 2002 05:41:37 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 30 Mar 2002 05:41:37 GMT Approved: bug-gdb-request@mail.gnu.org Newsgroups: gnu.gdb.bug Sender: bug-gdb-request@mail.gnu.org Lines: 92