octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #54231] GUI attempts to open file for function


From: Rik
Subject: [Octave-bug-tracker] [bug #54231] GUI attempts to open file for function declared at top-level
Date: Mon, 9 Jul 2018 17:57:06 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:61.0) Gecko/20100101 Firefox/61.0

Follow-up Comment #17, bug #54231 (project octave):

@Dan: Just for clarity, I have uploaded yourtest.m which is a copy of the OP's
code.

The reason that dbwhere is faliing in the CLI is related to how functions are
parsed in scripts.  When you execute a script that defines functions those
functions are entered in to the symbol table as command-line functions.

Here is an example in action.


octave:1> diary on
octave:2> which ggg
octave:3> source yourtest.m
a =  1
x =  3
ans =  3
octave:4> which ggg
'ggg' is a command-line function
octave:5> dbstop ggg
ans =  4
octave:6> ggg (8)
error: called from
    ggg at line 4 column 4
error: ggg: no such file, ''
octave:6> diary off


The issue is that the command-line function has the file name '' (i.e., blank)
associated with it and when Octave goes to print the necessary debug
information it finds no file and emits an error.

But, notice that this isn't the case with a true command-line function.


octave:1> diary on
octave:2> function y = myfunc (x)
> y = 2 * x;
> endfunction
octave:3> dbstop myfunc
ans =  2
octave:4> myfunc (8)
debug> dbwhere
stopped in myfunc at line 2
debug> dbquit


So, it can be made to work.  Octave is probably setting some of the symbol
table meta-information to specific values when it is a true command-line
function.




(file #44529)
    _______________________________________________________

Additional Item Attachment:

File name: yourtest.m                     Size:0 KB


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?54231>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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