From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4947 invoked from network); 30 Jul 2008 08:23:52 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 30 Jul 2008 08:23:52 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 27749 invoked from network); 30 Jul 2008 08:23:48 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 30 Jul 2008 08:23:48 -0000 Received: (qmail 11055 invoked by alias); 30 Jul 2008 08:23:45 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 25351 Received: (qmail 11043 invoked from network); 30 Jul 2008 08:23:45 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 30 Jul 2008 08:23:45 -0000 Received: from cluster-g.mailcontrol.com (cluster-g.mailcontrol.com [208.87.233.190]) by bifrost.dotsrc.org (Postfix) with ESMTPS id 89E7580561C9 for ; Wed, 30 Jul 2008 10:23:42 +0200 (CEST) Received: from cameurexb01.EUROPE.ROOT.PRI ([193.128.72.68]) by rly28g.srv.mailcontrol.com (MailControl) with ESMTP id m6U8Ndre004446 for ; Wed, 30 Jul 2008 09:23:40 +0100 Received: from news01.csr.com ([10.103.143.38]) by cameurexb01.EUROPE.ROOT.PRI with Microsoft SMTPSVC(6.0.3790.3959); Wed, 30 Jul 2008 09:23:39 +0100 Received: from news01.csr.com (localhost.localdomain [127.0.0.1]) by news01.csr.com (8.14.2/8.13.4) with ESMTP id m6U8Ndf8016239 for ; Wed, 30 Jul 2008 09:23:39 +0100 Received: from csr.com (pws@localhost) by news01.csr.com (8.14.2/8.14.2/Submit) with ESMTP id m6U8Ndvs016235 for ; Wed, 30 Jul 2008 09:23:39 +0100 Message-Id: <200807300823.m6U8Ndvs016235@news01.csr.com> X-Authentication-Warning: news01.csr.com: pws owned process doing -bs To: zsh-workers@sunsite.dk Subject: Re: trap DEBUG should get run beforehand, not afterwards. In-reply-to: <6cd6de210807291937p5e864c38o6dd9785acf62632c@mail.gmail.com> References: <6cd6de210807291937p5e864c38o6dd9785acf62632c@mail.gmail.com> Comments: In-reply-to "Rocky Bernstein" message dated "Tue, 29 Jul 2008 22:37:32 -0400." Date: Wed, 30 Jul 2008 09:23:39 +0100 From: Peter Stephenson X-OriginalArrivalTime: 30 Jul 2008 08:23:39.0164 (UTC) FILETIME=[91A67DC0:01C8F21D] X-Scanned-By: MailControl A-08-50-03 (www.mailcontrol.com) on 10.71.0.138 X-Virus-Scanned: ClamAV 0.92.1/7888/Wed Jul 30 09:23:13 2008 on bifrost X-Virus-Status: Clean "Rocky Bernstein" wrote: > Think for example about whether you'd like to know that 'rm -fr *' is > about to occur or just occurred. > > ksh introduced trap DEBUG and bash, and zsh copied it. Both ksh and > bash originally ran after the statement; I guess because that is same > as other traps. However both have switched so that it is run before > the statement. > > Alas, it's impossible to contemplate writing any sort of serious > debugger unless "trap DEBUG" gets run beforehand. Use the option DEBUG_BEFORE_CMD. -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070