From owner-p4-projects@FreeBSD.ORG Mon Jul 5 22:00:58 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 6099416A534; Mon, 5 Jul 2004 22:00:57 +0000 (GMT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3D57316A517 for ; Mon, 5 Jul 2004 22:00:32 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3A5F743D58 for ; Mon, 5 Jul 2004 22:00:32 +0000 (GMT) (envelope-from marcel@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.11/8.12.11) with ESMTP id i65M0WjM092124 for ; Mon, 5 Jul 2004 22:00:32 GMT (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.11/8.12.11/Submit) id i65M0VIu092121 for perforce@freebsd.org; Mon, 5 Jul 2004 22:00:31 GMT (envelope-from marcel@freebsd.org) Date: Mon, 5 Jul 2004 22:00:31 GMT Message-Id: <200407052200.i65M0VIu092121@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to marcel@freebsd.org using -f From: Marcel Moolenaar To: Perforce Change Reviews Subject: PERFORCE change 56545 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Jul 2004 22:00:58 -0000 http://perforce.freebsd.org/chv.cgi?CH=56545 Change 56545 by marcel@marcel_nfs on 2004/07/05 21:59:39 Implement makectx() on i386. Tested and working. Affected files ... .. //depot/projects/gdb/sys/i386/i386/machdep.c#12 edit Differences ... ==== //depot/projects/gdb/sys/i386/i386/machdep.c#12 (text+ko) ==== @@ -2217,6 +2217,25 @@ } #endif /* defined(I586_CPU) && !NO_F00F_HACK */ +/* + * Construct a PCB from a trapframe. This is called from kdb_trap() where + * we want to start a backtrace from the function that caused us to enter + * the debugger. We have the context in the trapframe, but base the trace + * on the PCB. The PCB doesn't have to be perfect, as long as it contains + * enough for a backtrace. + */ +void +makectx(struct trapframe *tf, struct pcb *pcb) +{ + + pcb->pcb_edi = tf->tf_edi; + pcb->pcb_esi = tf->tf_esi; + pcb->pcb_ebp = tf->tf_ebp; + pcb->pcb_ebx = tf->tf_ebx; + pcb->pcb_eip = tf->tf_eip; + pcb->pcb_esp = (ISPL(tf->tf_cs)) ? tf->tf_esp : (int)(tf + 1) - 8; +} + int ptrace_set_pc(struct thread *td, u_long addr) {