From owner-freebsd-current@FreeBSD.ORG Sun May 18 23:25:12 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6A84E37B405; Sun, 18 May 2003 23:25:12 -0700 (PDT) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 366C743FBD; Sun, 18 May 2003 23:25:08 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from katana.zip.com.au (katana.zip.com.au [61.8.7.246]) by mailman.zeta.org.au (8.9.3p2/8.8.7) with ESMTP id QAA20402; Mon, 19 May 2003 16:24:53 +1000 Date: Mon, 19 May 2003 16:24:52 +1000 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Ian Dowse In-Reply-To: <200305182227.aa40061@salmon.maths.tcd.ie> Message-ID: <20030519161526.T22357@gamplex.bde.org> References: <200305182227.aa40061@salmon.maths.tcd.ie> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: current@freebsd.org Subject: Re: kgdb missing stack frames X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 May 2003 06:25:12 -0000 On Sun, 18 May 2003, Ian Dowse wrote: > Support for decoding i386 trap frames in kgdb appears to have been > lost by revision 1.3 of contrib/gdb/gdb/config/i386/tm-fbsd.h, since > FRAME_SAVED_PC() is defined there in terms of i386bsd_frame_saved_pc(), > so fbsd_kern_frame_saved_pc() in gnu/usr.bin/binutils/gdb/kvm-fbsd.c > never gets called. A simple way to see this is to run > > gdb -k kernel.debug /dev/mem > > and get a backtrace from the idle process: > > (kgdb) proc 11 > (kgdb) bt > #0 mi_switch () at ../../../kern/kern_synch.c:530 > #1 0xc01edb92 in ithread_schedule (ithread=0xc1898280, do_switch=1) > at ../../../kern/kern_intr.c:402 > #2 0xc034ad43 in sched_ithd (cookie=0xc1894d80) > at ../../../i386/isa/ithread.c:77 > #3 0xc03380cc in Xintr14 () at {standard input}:382 > #4 0xc01ed16c in idle_proc (dummy=0x0) at ../../../kern/kern_idle.c:114 > #5 0xc01ecea0 in fork_exit (callout=0xc01ed130 , arg=0x0, > frame=0x0) at ../../../kern/kern_fork.c:792 > > This is what it should look like: > > (kgdb) proc 11 > (kgdb) bt > #0 mi_switch () at ../../../kern/kern_synch.c:530 > #1 0xc01edb92 in ithread_schedule (ithread=0xc1898280, do_switch=1) > at ../../../kern/kern_intr.c:402 > #2 0xc034ad43 in sched_ithd (cookie=0xc1898280) > at ../../../i386/isa/ithread.c:77 > #3 0xc033e242 in cpu_idle () at ../../../i386/i386/machdep.c:1074 > #4 0xc01ed16c in idle_proc (dummy=0x0) at ../../../kern/kern_idle.c:114 > #5 0xc01ecea0 in fork_exit (callout=0xc01ed130 , arg=0x0, > frame=0x0) at ../../../kern/kern_fork.c:792 > > i.e, the cpu_idle() frame now appears instead of Xintr14(). This is no better, since it loses Xintr14()'s frame instead of cpu_idle()'s frame. OTOH, it wouldnt hurt in most cases to lose all the frames below cpu_idle() and above idle_proc(), since they are not really associated with the process. Bruce