[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Improving 'verbose'

From: cgd
Subject: Re: Improving 'verbose'
Date: 11 Jul 2003 13:06:45 -0700
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

At Fri, 11 Jul 2003 12:03:29 -0700, Dan Kegel wrote:
> Has anyone ever modified dejagnu's 'verbose' to print
> the file, function name, and line number of the caller
> as a prefix to the line?  That would help immensely
> in tracking down problems.

(well, assuming you could do it, obviously you'd only want to enable
it if extra bonus nukular verbose.  8-)

But I'm not even sure how one *could* do this.

The tcl interpreter does it for errors...  unfortunately, it doesn't
look like the mechanism is exposed in any way.

It looks like the info included in errorInfo at error-time is
collected as the interpreter unwinds the call chain, and (empirically)
if you use 'catch' the call chain included in errorInfo ends inside
the catch.  (i.e., you don't see anything 'outside' the catch.)

So it doesn't look like you could actually use catch plus an
intentional error to do it.

It looks like you could maybe use 'info level' to give you a limited
call trace:

        proc calltrace {} {
            for {set i [info level]} {$i >= 1} {incr i -1} {
                 puts "$i: [info level $i]"
        proc foo {arg} { bar $arg another }
        proc bar {arg nextarg} { calltrace }

        foo foo-arg


        3: calltrace
        2: bar foo-arg another
        1: foo foo-arg

but that doesn't tell you all you want to know.

Good luck.  8-)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]