From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6272 invoked by alias); 13 Mar 2013 10:32:16 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 31147 Received: (qmail 10804 invoked from network); 13 Mar 2013 10:32:13 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_PASS autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at samsung.com does not designate permitted sender hosts) X-AuditID: cbfec7f4-b7f4c6d0000018de-ca-5140534fac84 Date: Wed, 13 Mar 2013 10:22:06 +0000 From: Peter Stephenson To: Zsh Hackers' List Subject: More useful variable tracing Message-id: <20130313102206.5ee8e3b1@pwslap01u.europe.root.pri> In-reply-to: <20130313001738.GA23091@redoubt.spodhuis.org> References: <20130313001738.GA23091@redoubt.spodhuis.org> Organization: Samsung Cambridge Solution Centre X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.0; i386-redhat-linux-gnu) MIME-version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupiluLIzCtJLcpLzFFi42I5/e/4ZV3/YIdAg9UdGhYHmx8yOTB6rDr4 gSmAMYrLJiU1J7MstUjfLoErY/mfY4wF+7krju2Wa2CcwNnFyMkhIWAisbHzMBOELSZx4d56 ti5GLg4hgaWMEt8u7GUESQgJLGeS+DFXDsRmEVCVuPR8PzuIzSZgKDF102ygGg4OEQFtifaP YiBhYaCSW/fusIDYvAL2EtdONYGN4RSwkthxaxsLxMgmRokJs3xBbH4BfYmrfz9B3WAvMfPK GUaIXkGJH5PvgdUzC2hJbN7WxAphy0tsXvOWeQKjwCwkZbOQlM1CUraAkXkVo2hqaXJBcVJ6 rqFecWJucWleul5yfu4mRkj4fdnBuPiY1SFGAQ5GJR7eDa/tA4VYE8uKK3MPMUpwMCuJ8M5w cwgU4k1JrKxKLcqPLyrNSS0+xMjEwSnVwMh28Kp51d7pkxqX7GhedOJsaNy8mHct7z76PnFP bZ/EapPvvO6FdplmWnCdw3P7vBNqdWeZY1e3ius7tZmlLVrVXyBzW46760S4LJvEl8n9Rznz TSvbV7xsOBzqZ91us3LTqbehNSs+mgna7l+uevZU6d1cVffaDQv+2X44nhN++uvtW8y2Ekos xRmJhlrMRcWJAKrNt2wdAgAA On Tue, 12 Mar 2013 20:17:38 -0400 Phil Pennock wrote: > On 2013-03-12 at 18:08 -0400, James Jong wrote: > > Why are these paths added to $PATH? Any pointers on what I can look at? > > tcsh> zsh -x > > If you do that, and also capture stderr to a file, and immediately quit, > then you can grep the stderr output for references to PATH or path. > Ignore fpath, module_path, manpath, etc etc. > > This should get rid of most of the cruft: > % pcregrep -n '\b(?i)path\b' zsh.trace > > Use the line-numbers to find the matches in the full output and trace > back where the lines come from. Off the wall aside, vaguely related to Bart's point about tracing array subscripts: I've had the growing suspicion we ought to be able to do a lot better than this with only moderate effort. Tracing setting of variables is a particularly common thing to do. It would be good to come up with something that can be set on the command line that can cause tracing of a given set of variables (so whatever we did would need to take effect before initialisation files but not otherwise affect the start sequence). It might take a while to find all the places internally that need to check, but the code shouldn't actually be that hard. Maybe there's something more sophisticated we can do involving pattern matching on xtrace output, but I suspect that's just making it harder to trap the common cases. pws