gdb: missing frames in frame stack or function name garbled

gdb: missing frames in frame stack or function name garbled

Post by Alex Cic » Sun, 31 Mar 2002 14:43:32



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"

 
 
 

1. Every other video4linux frame is garbled?

Hi,

I'm writing an application to use video4linux. I'm using the ibmcam
driver and with an IBM Webcam.

I capture frames by repeatedly calling:

read(cam->fd, buffer, (cam->vw.width) * (cam->vw.height) *
sizeof(pixel_t) );

Do I need to do something between each call to read()?

I'm dumping each buffer out to a file (I've done ppm and jpg) and
every other frame has garbled data in it. I've slowed down the rate at
which I call read (like once per second), but it doesn't make a
difference.

What am I doing wrong?

BTW, this is on a RedHat 7.1 system.

Thanks!
John

2. Where can I get Add user script ?

3. what causes 0x0 in stack frame?

4. Trouble compiling TeX

5. gcc stack frame layout for linux?

6. DHCP_REQUEST, then a time out.

7. Bogus end() stack frames under Linux

8. Problem with setting up slackware

9. a RS6000 stack frame

10. Frame Relay stack on Linux

11. request for info on stack and frame pointers on sparc

12. vfork and stack frame

13. shrink check_nmi_watchdog stack frame