changeset 25034:6e4121c39957 stable

enable debugging flag and code echo for command-line functions * input.cc (get_debug_input): Signal debug mode for octave_link and echo code when code comes from command line.
author John W. Eaton <jwe@octave.org>
date Wed, 28 Mar 2018 05:37:45 -0400
parents 336c167b1883
children ae487ce89992 fa2f8ffd088e
files libinterp/corefcn/input.cc
diffstat 1 files changed, 11 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/input.cc	Tue Mar 27 21:15:52 2018 -0700
+++ b/libinterp/corefcn/input.cc	Wed Mar 28 05:37:45 2018 -0400
@@ -623,16 +623,12 @@
   std::string nm;
   int curr_debug_line;
 
-  bool have_file = false;
-
   if (caller)
     {
       nm = caller->fcn_file_name ();
 
       if (nm.empty ())
         nm = caller->name ();
-      else
-        have_file = true;
 
       curr_debug_line = cs.caller_user_code_line ();
     }
@@ -663,25 +659,22 @@
                 buf << " at line " << curr_debug_line;
             }
 
-          if (have_file)
-            {
-              octave_link::enter_debugger_event (nm, curr_debug_line);
+          octave_link::enter_debugger_event (nm, curr_debug_line);
 
-              octave_link::set_workspace ();
+          octave_link::set_workspace ();
 
-              frame.add_fcn (execute_in_debugger_handler,
-                             std::pair<std::string, int> (nm, curr_debug_line));
+          frame.add_fcn (execute_in_debugger_handler,
+                         std::pair<std::string, int> (nm, curr_debug_line));
 
-              if (! silent)
-                {
-                  std::string line_buf;
+          if (! silent)
+            {
+              std::string line_buf;
 
-                  if (caller)
-                    line_buf = caller->get_code_line (curr_debug_line);
+              if (caller)
+                line_buf = caller->get_code_line (curr_debug_line);
 
-                  if (! line_buf.empty ())
-                    buf << "\n" << curr_debug_line << ": " << line_buf;
-                }
+              if (! line_buf.empty ())
+                buf << "\n" << curr_debug_line << ": " << line_buf;
             }
         }
     }