|
From: Vikas <cat...@gm...> - 2007-01-24 06:19:21
|
Hi ,
I am facing a strange problem . The lackey runs fine with any binary . But
when i run it in gdb i am getting seg fault in vg_despatch.S ( the assembly
code ) .
I just changed this code for debugging purpose in vg_main.c ,
line:2957 /* Hook to delay things long enough so we can get the pid and
attach GDB in another shell. */
if (VG_(clo_wait_for_gdb)) {
if (1) {
Int p, q;
for ( p = 0; p < 300000; p++ )
for ( q = 0; q < 50000; q++ ) ;
}
VG_(printf)("pid=%d\n", VG_(getpid)());
/* do "jump *$eip" to skip this in gdb */
// VG_(do_syscall)(__NR_pause);
}
[vicky@ganesh:valgrind] #gdb ./stage2 23129
GNU gdb 6.4-debian
Copyright 2005 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 "i486-linux-gnu"...Using host libthread_db
library "/lib/tls/i686/cmov/libthread_db.so.1".
Attaching to program:
/home/vicky/ganesh/research/jan22/valgrind-2.2.0/ganesh/lib/valgrind/stage2,
process 23129
Reading symbols from /lib/tls/i686/cmov/libdl.so.2...done.
Loaded symbols for /lib/tls/i686/cmov/libdl.so.2
Reading symbols from /lib/tls/i686/cmov/libc.so.6...done.
Loaded symbols for /lib/tls/i686/cmov/libc.so.6
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
Reading symbols from /home/vicky/ganesh/research/jan22/valgrind-2.2.0
/ganesh/lib/valgrind/vgskin_lackey.so...done.
Loaded symbols for /home/vicky/ganesh/research/jan22/valgrind-2.2.0
/ganesh/lib/valgrind/vgskin_lackey.so
main (argc=4, argv=0x70) at vg_main.c:2964
2964 for ( q = 0; q < 50000; q++ ) ;
(gdb) n
2963 for ( p = 0; p < 300000; p++ )
(gdb) n
2964 for ( q = 0; q < 50000; q++ ) ;
(gdb) n
2963 for ( p = 0; p < 300000; p++ )
(gdb) b lk_main.c:201
Breakpoint 1 at 0xb7fedee4: file lk_main.c, line 201.
(gdb) continue
Continuing.
Program received signal SIGSEGV, Segmentation fault.
0xb0774158 in ?? ()
(gdb) backtrace
#0 0xb0774158 in ?? ()
#1 0xb00138c0 in dispatch_main ()
#2 0x00000000 in ?? ()
(gdb)
Any help is really appreciated because it is blocking my work too much .
Warm Regards,
vikas
|