Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
More useful variable tracing
- X-seq: zsh-workers 31147
- From: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
- To: Zsh Hackers' List <zsh-workers@xxxxxxx>
- Subject: More useful variable tracing
- Date: Wed, 13 Mar 2013 10:22:06 +0000
- In-reply-to: <20130313001738.GA23091@redoubt.spodhuis.org>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- Organization: Samsung Cambridge Solution Centre
- References: <CAD4ivxXVaur2-yswW1L+TwViEuY8dUij9ZBV9gniJaZyQue-Cg@mail.gmail.com> <20130313001738.GA23091@redoubt.spodhuis.org>
On Tue, 12 Mar 2013 20:17:38 -0400
Phil Pennock <zsh-workers+phil.pennock@xxxxxxxxxxxx> 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author