NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/30756: gdb not usable for live debugging of threaded programs



The following reply was made to PR bin/30756; it has been noted by GNATS.

From: Nick Hudson <nick.hudson%gmx.co.uk@localhost>
To: gnats-bugs%netbsd.org@localhost,
 pkoning%netbsd.org@localhost
Cc: gnats-admin%netbsd.org@localhost,
 netbsd-bugs%netbsd.org@localhost,
 Thomas Klausner <wiz%netbsd.org@localhost>
Subject: Re: bin/30756: gdb not usable for live debugging of threaded programs
Date: Fri, 4 Jun 2010 11:49:20 +0100

 --Boundary-00=_woNCMfd6ODsW23f
 Content-Type: text/plain;
   charset="iso-8859-1"
 Content-Transfer-Encoding: 7bit
 
 On Thursday 22 April 2010 16:20:04 Paul Koning wrote:
 >  Antti pointed out a problem in the patch I originally submitted which
 >  causes gdb to go into a loop if the child process exits.  The attached
 >  updated patch corrects that problem.
 
 This, unfortunately, still has cosmetic issues. See the attached log and the 
 "Couldn't get registers: Operation not permitted." at the end of the session
 
 Nick
 
 --Boundary-00=_woNCMfd6ODsW23f
 Content-Type: text/x-log;
   charset="iso-8859-1";
   name="gdb-attach.log"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment;
        filename="gdb-attach.log"
 
 (gdb) set debug nbsd-thread 1
 (gdb) attach 1049
 Attaching to process 1049
 NTW2: waiting for ptid -1,0, opt 0
 NTW2: waitpid errno is 0, pid 1049, status 117f
 NTUP: lwpinfo on 0 returns lwp 1, pl_event 0
 NTUP: adding first thread ptid 1049,1
 NTUP: lwpinfo on 1 returns lwp 0, pl_event 0
 NTUP: signalled thread lwpid is 0
 NTW2: waiting for ptid 1049,0, opt 1
 NTW2: waitpid errno is 0, pid 0, status 0
 NTW: no signalled thread
 NTW: returning ptid 1049,1
 NFIR: ptid 1049,1, regnum 8: 804865a
 Reading symbols from /home/nick/gdb/obj/gdb/testsuite/gdb.base/attach...done.
 NFIR: ptid 1049,1, regnum 8: 804865a
 Reading symbols from /usr/lib/libm.so.0...done.
 Loaded symbols for /usr/lib/libm.so.0
 Reading symbols from /usr/lib/libc.so.12...done.
 Loaded symbols for /usr/lib/libc.so.12
 Reading symbols from /usr/libexec/ld.elf_so...done.
 Loaded symbols for /usr/libexec/ld.elf_so
 [Switching to Thread 1]
 main () at ../../../src/gdb/testsuite/gdb.base/attach.c:17
 17            local_i++;
 (gdb) print should_exit
 $1 = 0
 (gdb) detach
 Detaching from program: /home/nick/gdb/obj/gdb/testsuite/gdb.base/attach, 
process 1049
 (gdb) attach 1049
 Attaching to program: /home/nick/gdb/obj/gdb/testsuite/gdb.base/attach, 
process 1049
 NTW2: waiting for ptid -1,0, opt 0
 NTW2: waitpid errno is 0, pid 1049, status 117f
 NTUP: lwpinfo on 0 returns lwp 1, pl_event 0
 NTUP: lwpinfo on 1 returns lwp 0, pl_event 0
 NTUP: signalled thread lwpid is 0
 NTW2: waiting for ptid 1049,0, opt 1
 NTW2: waitpid errno is 0, pid 0, status 117f
 NTW: no signalled thread
 NTW: returning ptid 1049,0
 NFIR: ptid 1049,0, regnum 8: 804865d
 Loaded symbols for /usr/lib/libm.so.0
 Loaded symbols for /usr/lib/libc.so.12
 Loaded symbols for /usr/libexec/ld.elf_so
 main () at ../../../src/gdb/testsuite/gdb.base/attach.c:15
 15        while (! should_exit)
 (gdb) set should_exit=1
 (gdb) tbreak 19
 Breakpoint 1 at 0x8048666: file ../../../src/gdb/testsuite/gdb.base/attach.c, 
line 19.
 (gdb) c
 Continuing.
 NTR: resuming ptid 1049,0, all threads, signal 0
 NTW2: waiting for ptid -1,0, opt 0
 NTW2: waitpid errno is 0, pid 1049, status 57f
 NTUP: lwpinfo on 0 returns lwp 1, pl_event 1
 NTUP: lwpinfo on 1 returns lwp 0, pl_event 0
 NTUP: signalled thread lwpid is 1
 NTW2: waiting for ptid 1049,0, opt 1
 NTW2: waitpid errno is 0, pid 0, status 57f
 NTW: Picking ptid 1049,1 out of 1
 NTW: returning ptid 1049,1
 NFIR: ptid 1049,1, regnum 8: 8048667
 NSIR: ptid 1049,1, regnum 8: 8048666
 [Switching to Thread 1]
 main () at ../../../src/gdb/testsuite/gdb.base/attach.c:19
 19        return 0;
 (gdb) c
 Continuing.
 NTR: resuming ptid 1049,1, all threads, signal 0
 NTW2: waiting for ptid -1,0, opt 0
 NTW2: waitpid errno is 0, pid 1049, status 0
 NTUP: signalled thread lwpid is 0
 NTW2: waiting for ptid 1049,0, opt 1
 NTW2: waitpid errno is 10, pid -1, status 0
 NTW: no signalled thread
 NTW: returning ptid 1049,1
 
 Program exited normally.
 Couldn't get registers: Operation not permitted.
 (gdb)
 
 --Boundary-00=_woNCMfd6ODsW23f--
 


Home | Main Index | Thread Index | Old Index