bugGNU Octave - Bugs: bug #53453, octave -x stops echoing on...

 
 

bug #53453: octave -x stops echoing on descending into a function call

Submitter:  A.R. Burgers <arb>
Submitted:  Sat 24 Mar 2018 12:04:35 PM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Regression
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 30 Mar 2018 07:48:12 PM UTC, comment #3: 

Thanks, fixed on the stable branch for Octave 4.4

https://hg.savannah.gnu.org/hgweb/octave/rev/a211e39e59d9

Mike Miller <mtmiller>
Group Member
Fri 30 Mar 2018 06:08:38 PM UTC, comment #2: 

Mike: I don't remember that being intentional so I think your patch should be OK.


John W. Eaton <jwe>
Group administrator
Tue 27 Mar 2018 01:42:29 AM UTC, comment #1: 

The following patch fixes this for me


diff --git a/libinterp/corefcn/interpreter.cc b/libinterp/corefcn/interpreter.cc
--- a/libinterp/corefcn/interpreter.cc
+++ b/libinterp/corefcn/interpreter.cc
@@ -478,7 +478,7 @@ namespace octave

         if (options.echo_commands ())
           m_evaluator.echo
-            (tree_evaluator::ECHO_SCRIPTS | tree_evaluator::ECHO_FUNCTIONS);
+            (tree_evaluator::ECHO_SCRIPTS | tree_evaluator::ECHO_FUNCTIONS | tree_evaluator::ECHO_ALL);

         std::string docstrings_file = options.docstrings_file ();
         if (! docstrings_file.empty ())


Does that work for you?

jwe - I see that in ab8831d346c1, the previous code set the echo to ECHO_SCRIPTS | ECHO_FUNCTIONS | ECHO_CMD_LINE, but the current version only sets ECHO_SCRIPTS | ECHO_FUNCTIONS. Does it look right that the -x option should be the same as 'echo on all'?

Mike Miller <mtmiller>
Group Member
Sat 24 Mar 2018 12:04:35 PM UTC, original submission:  

consider this script:


function zz
    x = 3;
    zz2
end
function zz2
    y = 4;
end


and execute with this command:


octave --norc --no-init-path --no-init-file --no-site-file -x zz.m


octave-4.2.1 produces:


+ function zz ()
+ x = 3;
+ zz2
+ function zz2 ()
+ y = 4;
+ endfunction
+
+ endfunction


octave-4.3.0+ does not produce any output

If you invoke function zz from a script, say run_zz, with just one line invoking zz:


zz


then octave-4.3.0+ produces


+ zz
+


It looks like echoing stops in 4.3.0+ when descending into a function.

A.R. Burgers <arb>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by arb (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-03-30 mtmiller StatusPatch Submitted Fixed
        Open/ClosedOpen Closed
    2018-03-27 mtmiller StatusNone Patch Submitted

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code