From owner-cvs-src@FreeBSD.ORG Sat Jul 5 16:21:59 2003 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9FFF537B401; Sat, 5 Jul 2003 16:21:59 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 48D7744015; Sat, 5 Jul 2003 16:21:59 -0700 (PDT) (envelope-from marcel@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h65NLx0U006906; Sat, 5 Jul 2003 16:21:59 -0700 (PDT) (envelope-from marcel@repoman.freebsd.org) Received: (from marcel@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h65NLx1m006902; Sat, 5 Jul 2003 16:21:59 -0700 (PDT) Message-Id: <200307052321.h65NLx1m006902@repoman.freebsd.org> From: Marcel Moolenaar Date: Sat, 5 Jul 2003 16:21:58 -0700 (PDT) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/sys/ia64/ia64 db_trace.c unwind.c src/sys/ia64/include unwind.h X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Jul 2003 23:22:00 -0000 marcel 2003/07/05 16:21:58 PDT FreeBSD src repository Modified files: sys/ia64/ia64 db_trace.c unwind.c sys/ia64/include unwind.h Log: Don't call malloc() and free() while in the debugger and unwinding to get a stacktrace. This does not work even with M_NOWAIT when we have WITNESS and is generally a bad idea (pointed out by bde@). We allocate an 8K heap for use by the unwinder when ddb is active. A stack trace roughly takes up half of that in any case, so we have some room for complex unwind situations. We don't want to waste too much space though. Due to the nature of unwinding, we don't worry too much about fragmentation or performance of unwinding while in the debugger. For now we have our own heap management, but we may be able to leverage from existing code at some later time. While here: o Make sure we actually free the unwind environment after unwinding. This fixes a memory leak. o Replace Doug's license with mine in unwind.c and unwind.h. Both files don't have much, if any, of Doug's code left since the EPC syscall overhaul and the import of the unwinder. o Remove dead code. o Replace M_NOWAIT with M_WAITOK for all remaining malloc() calls. Revision Changes Path 1.16 +2 -0 src/sys/ia64/ia64/db_trace.c 1.8 +106 -42 src/sys/ia64/ia64/unwind.c 1.4 +14 -13 src/sys/ia64/include/unwind.h