zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.stephenson@samsung.com>
To: Zsh Hackers' List <zsh-workers@zsh.org>
Subject: More useful variable tracing
Date: Wed, 13 Mar 2013 10:22:06 +0000	[thread overview]
Message-ID: <20130313102206.5ee8e3b1@pwslap01u.europe.root.pri> (raw)
In-Reply-To: <20130313001738.GA23091@redoubt.spodhuis.org>

On Tue, 12 Mar 2013 20:17:38 -0400
Phil Pennock <zsh-workers+phil.pennock@spodhuis.org> 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


       reply	other threads:[~2013-03-13 10:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAD4ivxXVaur2-yswW1L+TwViEuY8dUij9ZBV9gniJaZyQue-Cg@mail.gmail.com>
     [not found] ` <20130313001738.GA23091@redoubt.spodhuis.org>
2013-03-13 10:22   ` Peter Stephenson [this message]
2013-03-14 11:12     ` PATCH: " Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130313102206.5ee8e3b1@pwslap01u.europe.root.pri \
    --to=p.stephenson@samsung.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).