Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Debugging of dynamocally defined functions

"Bart Schaefer" wrote:
> I was fooling with almost exactly the same thing, though I'd been trying
> to figure out a nice way to embed the line number of the eval inside the
> `(eval)' string; e.g. for an eval on line 30 of the calling function you
> would see something like
> (30:eval):1: echo foo
> (30:eval):2: echo bar
> etc.  However, as the placment of %i and the use of colons or whatnot is
> completely dependent on the PS4 setting, I couldn't decide how to do it
> such that it wouldn't garble somebody's pretty prompt.

Maybe we need to grab another prompt escape.  Or maybe we could make a
stack of environments and line numbers and you can choose whether you want
the line number (e.g.) in the innermost eval, in the function above that,
or in the script the function is embedded in, fixing the other problem,
too --- if we can work out a way of deciding which the right one to print
at any given time is.  Maybe this needs more work to make quite sure
scriptname and lineno are tied together.  Maybe we can add an option to get
errors to print a backtrace of that.  Maybe I'm rambling.

I've committed the patch for now.

Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR Ltd., Unit 300, Science Park, Milton Road,
Cambridge, CB4 0XL, UK                          Tel: +44 (0)1223 392070

The information transmitted is intended only for the person or
entity to which it is addressed and may contain confidential 
and/or privileged material. 
Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by 
persons or entities other than the intended recipient is 
If you received this in error, please contact the sender and 
delete the material from any computer.

Messages sorted by: Reverse Date, Date, Thread, Author