From owner-p4-projects@FreeBSD.ORG Tue Jul 6 01:53:22 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 9C39316A4D0; Tue, 6 Jul 2004 01:53:21 +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 4A8C616A4CE for ; Tue, 6 Jul 2004 01:53:21 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 443D643D1D for ; Tue, 6 Jul 2004 01:53:21 +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 i661rLBQ099227 for ; Tue, 6 Jul 2004 01:53:21 GMT (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.11/8.12.11/Submit) id i661rK4E099224 for perforce@freebsd.org; Tue, 6 Jul 2004 01:53:20 GMT (envelope-from marcel@freebsd.org) Date: Tue, 6 Jul 2004 01:53:20 GMT Message-Id: <200407060153.i661rK4E099224@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 56565 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: Tue, 06 Jul 2004 01:53:22 -0000 http://perforce.freebsd.org/chv.cgi?CH=56565 Change 56565 by marcel@marcel_sledge on 2004/07/06 01:52:46 Implement makectx() on amd64. It compiles. I think it'll work, but I can't test amd64 at all... Affected files ... .. //depot/projects/gdb/sys/amd64/amd64/machdep.c#15 edit Differences ... ==== //depot/projects/gdb/sys/amd64/amd64/machdep.c#15 (text+ko) ==== @@ -1283,6 +1283,27 @@ pcpu->pc_acpi_id = 0xffffffff; } +/* + * 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_r12 = tf->tf_r12; + pcb->pcb_r13 = tf->tf_r13; + pcb->pcb_r14 = tf->tf_r14; + pcb->pcb_r15 = tf->tf_r15; + pcb->pcb_rbp = tf->tf_rbp; + pcb->pcb_rbx = tf->tf_rbx; + pcb->pcb_rip = tf->tf_rip; + pcb->pcb_rsp = (ISPL(tf->tf_cs)) ? tf->tf_rsp : (long)(tf + 1) - 8; +} + int ptrace_set_pc(struct thread *td, unsigned long addr) {