Here's a simple test case:

demo.c:

#include <stdio.h>
#include <stdlib.h>
int x = 0;
int main(void) {
   while(1) {
      x++;
      printf("X is now %d.\n", x);
   }
   return(1);
}


%> g++ -g3  demo.c -o demo 
.....
Ctrl-Z

0 %> gdb -p `pgrep demo` demo

GNU gdb (GDB) 7.2-ubuntu
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /users/bedge/tmp/demo/demo...done.
Attaching to program: /users/bedge/tmp/demo/demo, process 12506
Reading symbols from /usr/lib/libstdc++.so.6...(no debugging symbols 
found)...done.
Loaded symbols for /usr/lib/libstdc++.so.6
Reading symbols from /lib/libm.so.6...Reading symbols from 
/usr/lib/debug/lib/libm-2.12.1.so...done.
done.
Loaded symbols for /lib/libm.so.6
Reading symbols from /lib/libgcc_s.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib/libgcc_s.so.1
Reading symbols from /lib/libc.so.6...Reading symbols from 
/usr/lib/debug/lib/libc-2.12.1.so...done.
done.
Loaded symbols for /lib/libc.so.6
Reading symbols from /lib/ld-linux.so.2...Reading symbols from 
/usr/lib/debug/lib/ld-2.12.1.so...done.
done.
Loaded symbols for /lib/ld-linux.so.2
0x003c8416 in __kernel_vsyscall ()
(gdb) where
#0  0x003c8416 in __kernel_vsyscall ()
#1  0x002baf53 in __write_nocancel () at ../sysdeps/unix/syscall-template.S:82
#2  0x002630d4 in _IO_new_file_write (f=0x3554e0, data=0xb771e000, n=16) at 
fileops.c:1276
#3  0x00262d5f in new_do_write (fp=0x3554e0, data=0xb771e000 "X is now 
78856.\n", to_do=16) at fileops.c:530
#4  0x00263076 in _IO_new_do_write (fp=0x3554e0, data=0xb771e000 "X is now 
78856.\n", to_do=16) at fileops.c:503
#5  0x00263b7d in _IO_new_file_overflow (f=0x3554e0, ch=-1) at fileops.c:881
#6  0x00262ea8 in _IO_new_file_xsputn (f=0x3554e0, data=0x804859b, n=2) at 
fileops.c:1358
#7  0x0023882a in _IO_vfprintf_internal (s=0x3554e0, format=0x8048590 "X is now 
%d.\n", ap=0xbfbc65b4 "\b4\001") at vfprintf.c:1644
#8  0x00242ad0 in __printf (format=0x8048590 "X is now %d.\n") at printf.c:35
#9  0x080484bf in main () at demo.c:7
(gdb) 

(gdb) gcore 
Saved corefile core.12506

-rw-r--r-- 1 bedge wlvusers 232352 2010-11-18 16:07 core.12506


0 %> gdb demo core.12506 

GNU gdb (GDB) 7.2-ubuntu
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /users/bedge/tmp/demo/demo...done.
[New Thread 12506]
Reading symbols from /lib/ld-linux.so.2...Reading symbols from 
/usr/lib/debug/lib/ld-2.12.1.so...done.
done.
Loaded symbols for /lib/ld-linux.so.2
Core was generated by `/users/bedge/tmp/demo/demo'.
#0  0x003c8416 in __kernel_vsyscall ()
(gdb) bt
#0  0x003c8416 in __kernel_vsyscall ()
#1  0x002baf53 in ?? ()
#2  0x00354ff4 in ?? ()
#3  0x002630d4 in ?? ()
#4  0x00000001 in ?? ()
#5  0xb771e000 in ?? ()
#6  0x00262d5f in ?? ()
#7  0x003554e0 in ?? ()
#8  0x00263076 in ?? ()
#9  0x00000010 in ?? ()
#10 0x003554e0 in ?? ()
#11 0x00263b7d in ?? ()
#12 0x003554e0 in ?? ()
#13 0x00262ea8 in ?? ()
#14 0x003554e0 in ?? ()
#15 0x0023882a in ?? ()
#16 0x003554e0 in ?? ()
#17 0x00242ad0 in ?? ()
#18 0xbfbc65c8 in ?? ()
#19 0x080484bf in main () at demo.c:7

Where's the stack info????

-- 
gcore produces the broken core bt in GDB displays backtrace abnormally.
https://bugs.launchpad.net/bugs/609666
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to