help-octave
[Top][All Lists]
Advanced

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

Re: Octave - stack trace in runtime mode possible?


From: Werner Koenig
Subject: Re: Octave - stack trace in runtime mode possible?
Date: Wed, 28 Aug 2013 17:58:13 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.2.28) Gecko/20120306 Thunderbird/3.1.20

On 28.08.2013 12:13, John W. Eaton wrote:
On 08/27/2013 07:21 PM, Werner Koenig wrote:
On 27.08.2013 22:35, c. wrote:
On 27 Aug 2013, at 18:30, Werner Koenig<address@hidden> wrote:

Hello Kai, hello list

thank you for your quick response. Yes, I want to make a stack trace
like in debug mode of octave.
The purpose is, I want to evaluate in a subroutine, which function
calls this routine and what
is the linenumber of this call.

So long

Werner
you can either add the command 'keyboard' at the beginning of your
function or issue the command 'dbstop<function name>'
Octave will open a debug prompt whenever your function is called.

At the debug prompt type 'dbstack' to see the full call stack
including line numbers.

HTH,
c.
Hello C., hello list

that isn't a solution, because octave falls at both proposals in
debug-mode and than i have todo something manually, but that is not what
I want.
Perhaps I wasn't clear enough in my previous mails. The subroutine needs
this informations and there is no break welcome, the program has
to be continued until it reached its normal end.

Just call dbstack:

  dbstack ();

will print out the "stopped in ..." message and

  x = dbstack ();

will return a structure with the stack info.

jwe

Hello John,

that was it. It is so simple (good ideas are often simple), but I never thought, this function works too in run-time mode. And I am happy, it is even silent .
(no message, I don't want more).  I tested it on an openSuse and on a
Windows 7-System.

Thanks for your help

So long Werner



reply via email to

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