From owner-freebsd-sparc64@FreeBSD.ORG Fri Jan 14 15:40:05 2005 Return-Path: Delivered-To: freebsd-sparc64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 76BB416A4CE for ; Fri, 14 Jan 2005 15:40:05 +0000 (GMT) Received: from callahan.capri.pl (callahan.capri.pl [217.149.242.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 39A8843D45 for ; Fri, 14 Jan 2005 15:40:04 +0000 (GMT) (envelope-from mk@capri.pl) Received: from cqf151.neoplus.adsl.tpnet.pl (cqf151.neoplus.adsl.tpnet.pl [83.31.237.151]) (authenticated bits=0) by callahan.capri.pl (8.12.9p2/8.12.9) with ESMTP id j0EFe0t3061095 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Fri, 14 Jan 2005 16:40:01 +0100 (CET) (envelope-from mk@capri.pl) Date: Fri, 14 Jan 2005 16:46:51 +0100 (CET) From: mk@capri.pl X-X-Sender: mk@grendel.oldford.pl To: sparc64@freebsd.org Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: gdb troubles with threaded program X-BeenThere: freebsd-sparc64@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Michal Konieczny List-Id: Porting FreeBSD to the Sparc List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Jan 2005 15:40:05 -0000 Hello, I'm trying to debug multi-threaded program (my own work), but unexpected things happen. On startup, I set breakpoint within one of the threads. Program is started, some time passes, gdb stops at the breakpoint. Just as expected. Then I try to single step through the code, and this is weird: sooner or later, but always, happens this: (gdb) n 0x000000004092820c in sigprocmask () from /lib/libc.so.5 (gdb) Single stepping until exit from function sigprocmask, which has no line number information. 0x00000000407a4390 in _thread_kern_scheduler () from /usr/lib/libc_r.so.5 (gdb) Single stepping until exit from function _thread_kern_scheduler, which has no line number information. 0x00000000407a4b20 in _thread_kern_sched_state_unlock () from /usr/lib/libc_r.so.5 (gdb) thread [Current thread is 0 (process 10819)] (gdb) n Single stepping until exit from function _thread_kern_sched_state_unlock, which has no line number information. 0x00000000407a4120 in kevent () from /usr/lib/libc_r.so.5 (gdb) Single stepping until exit from function kevent, which has no line number information. 0x00000000407a4b30 in _thread_kern_sched_state_unlock () from /usr/lib/libc_r.so.5 (gdb) Single stepping until exit from function _thread_kern_sched_state_unlock, which has no line number information. 0x00000000407a45f0 in _thread_kern_scheduler () from /usr/lib/libc_r.so.5 (gdb) Single stepping until exit from function _thread_kern_scheduler, which has no line number information. Breakpoint 1, lb731_get_log_record (comm=0x2d2800, cp=0x7fdffed9598) at ../../../../src/drivers/lb731/lb731.c:1537 1537 if (ptr[0] == 0x00) After stepping through some pthreads (?) code (as shown above), execution returns to my function, but it's other place than before. Quite often it just hangs after few steps through this - no return to my code, Ctrl-C does nothing, I have to kill gdb externally. Machine is Ultra2, FreeBSD 5.3 RELEASE. What's going on ? -- Michal Konieczny mk@capri.pl