From owner-p4-projects@FreeBSD.ORG Sun May 30 20:37:30 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4431F16A4D0; Sun, 30 May 2004 20:37:30 -0700 (PDT) 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 F3D6B16A4CE for ; Sun, 30 May 2004 20:37:29 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id D6F5843D1F for ; Sun, 30 May 2004 20:37:29 -0700 (PDT) (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 i4V3bTdO073047 for ; Sun, 30 May 2004 20:37:29 -0700 (PDT) (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.11/8.12.11/Submit) id i4V3bStZ073044 for perforce@freebsd.org; Sun, 30 May 2004 20:37:29 -0700 (PDT) (envelope-from marcel@freebsd.org) Date: Sun, 30 May 2004 20:37:29 -0700 (PDT) Message-Id: <200405310337.i4V3bStZ073044@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 53842 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, 31 May 2004 03:37:30 -0000 http://perforce.freebsd.org/chv.cgi?CH=53842 Change 53842 by marcel@marcel_nfs on 2004/05/30 20:36:38 Have get_esp() take a pointer to a trapframe so that it works with any thread, not just the one that entered the debugger. Affected files ... .. //depot/projects/gdb/sys/i386/i386/db_trace.c#5 edit Differences ... ==== //depot/projects/gdb/sys/i386/i386/db_trace.c#5 (text+ko) ==== @@ -59,10 +59,10 @@ static db_varfcn_t db_esp; static __inline int -get_esp(void) +get_esp(struct trapframe *tf) { - return ((ISPL(ddb_regs.tf_cs)) ? ddb_regs.tf_esp : - (db_expr_t)kdb_frame + offsetof(struct trapframe, tf_esp)); + return ((ISPL(tf->tf_cs)) ? tf->tf_esp : + (db_expr_t)tf + offsetof(struct trapframe, tf_esp)); } /* @@ -125,7 +125,7 @@ db_esp (struct db_variable *vp, db_expr_t *valuep, int op) { if (op == DB_VAR_GET) - *valuep = get_esp(); + *valuep = get_esp(kdb_frame); else if (ISPL(ddb_regs.tf_cs)) ddb_regs.tf_esp = *valuep; return (0); @@ -300,7 +300,7 @@ tf = (struct trapframe *)((int)*fp + 8); if (INKERNEL((int) tf)) { - esp = get_esp(); + esp = get_esp(tf); eip = tf->tf_eip; ebp = tf->tf_ebp; switch (frame_type) { @@ -366,20 +366,20 @@ instr = db_get_value(pc, 4, FALSE); if ((instr & 0xffffff) == 0x00e58955) { /* pushl %ebp; movl %esp, %ebp */ - actframe = (void *)(get_esp() - 4); + actframe = (void *)(get_esp(tf) - 4); } else if ((instr & 0xffff) == 0x0000e589) { /* movl %esp, %ebp */ - actframe = (void *)get_esp(); + actframe = (void *)get_esp(tf); if (ddb_regs.tf_ebp == 0) { /* Fake frame better. */ frame = actframe; } } else if ((instr & 0xff) == 0x000000c3) { /* ret */ - actframe = (void *)(get_esp() - 4); + actframe = (void *)(get_esp(tf) - 4); } else if (offset == 0) { /* Probably an assembler symbol. */ - actframe = (void *)(get_esp() - 4); + actframe = (void *)(get_esp(tf) - 4); } } else if (strcmp(name, "fork_trampoline") == 0) { /*