Message from discussion Proposal for an exception-like mechanism
Received: by 10.220.47.164 with SMTP id n36ls1604869vcf.1.p; Thu, 25 Mar 2010
13:08:41 -0700 (PDT)
Received: by 10.220.49.164 with SMTP id v36mr2785084vcf.13.1269547717448;
Thu, 25 Mar 2010 13:08:37 -0700 (PDT)
Received: by 10.220.49.164 with SMTP id v36mr2785003vcf.13.1269547702794;
Thu, 25 Mar 2010 13:08:22 -0700 (PDT)
Received: from mail-gw0-f56.google.com (mail-gw0-f56.google.com [126.96.36.199])
by gmr-mx.google.com with ESMTP id 29si282518vws.2.2010.03.25.13.08.21;
Thu, 25 Mar 2010 13:08:21 -0700 (PDT)
Received-SPF: pass (google.com: domain of esko.luont...@gmail.com designates 188.8.131.52 as permitted sender) client-ip=184.108.40.206;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of esko.luont...@gmail.com designates 220.127.116.11 as permitted sender) smtp.mail=esko.luont...@gmail.com
Received: by mail-gw0-f56.google.com with SMTP id a12so9178018gwa.1
for <firstname.lastname@example.org>; Thu, 25 Mar 2010 13:08:21 -0700 (PDT)
Received: by k19g2000yqn.googlegroups.com with HTTP; Thu, 25 Mar 2010 13:08:21
Date: Thu, 25 Mar 2010 13:08:21 -0700 (PDT)
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US)
AppleWebKit/532.5 (KHTML, like Gecko) Chrome/18.104.22.1682
Received: by 10.150.233.5 with SMTP id f5mr110070ybh.71.1269547701819; Thu, 25
Mar 2010 13:08:21 -0700 (PDT)
Subject: Re: Proposal for an exception-like mechanism
From: Esko Luontola <esko.luont...@gmail.com>
To: golang-nuts <email@example.com>
Content-Type: text/plain; charset=ISO-8859-1
On Mar 25, 9:57=A0pm, Russ Cox <r...@golang.org> wrote:
> > Can I use runtime.Callers() and runtime.FuncForPC() to generate
> > exactly the same stack trace as would happen when the program
> > terminates?
> Almost. =A0Not quite, because you can't get at the argument values.
> But the argument values printed in the panic traces aren't useful
> anyway, unless you're comfortable reading the binary representation
> of the various data structures. =A0You can certainly make it look
> substantially similar. =A0The loss of the argument values is not such
> a big deal since they're not really readable as it is.
> I think it's safe to say that the interface to the active call stack
> is still evolving. =A0It's a little too ad hoc right now.
> > Where is the code that Go is currently using for
> > formatting the stack trace?
> src/pkg/runtime/amd64/traceback.c (even on 386)
Also the exception proposal looks promising. :)