zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@csr.com>
To: zsh-workers@sunsite.dk
Subject: Re: Getting source file and line number of a function.
Date: Mon, 28 Jul 2008 09:34:14 +0100	[thread overview]
Message-ID: <200807280834.m6S8YEVo026326@news01.csr.com> (raw)
In-Reply-To: <6cd6de210807261806r7ff184fdtcc7859cca0a98aef@mail.gmail.com>

"Rocky Bernstein" wrote:
> I see that zsh has now has array variables functrace and
> funcstack. Functrace stack gives a function name and a line offset
> from the function. But for many things involving location reporting,
> it would more be desirable to have a filename and absolute line
> location.
> 
> Alternatively, if there were a way to get the filename and line number
> of the beginning of a given function, one can do some arithmetic to
> get the absolute position.
> 
> Is there currently a way to get this information. Should I try at
> submitting a patch?

It would be useful to have information referred to the autoload file,
and I've wondered about how to do it, but I don't think it's trivial
with the current way line numbers work.  We would probably need to add
an extra internal variable for file line numbers, and present another
variable (or array, if in the funcstack style) to users to distinguish
the two.

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


  reply	other threads:[~2008-07-28  8:34 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-27  1:06 Rocky Bernstein
2008-07-28  8:34 ` Peter Stephenson [this message]
2008-07-28 12:46   ` Rocky Bernstein
2008-07-30  2:31     ` Rocky Bernstein
2008-07-30  8:22       ` Peter Stephenson
2008-08-09 18:21     ` Peter Stephenson
2008-08-10  1:11       ` Rocky Bernstein
2008-08-11 19:32         ` Peter Stephenson
2008-08-11 19:39           ` Rocky Bernstein
2008-08-11 19:51             ` Peter Stephenson
2008-08-11 20:01               ` Rocky Bernstein
2008-08-11 14:00       ` Richard Hartmann
2008-08-13 20:51         ` 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=200807280834.m6S8YEVo026326@news01.csr.com \
    --to=pws@csr.com \
    --cc=zsh-workers@sunsite.dk \
    /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).