diff libgui/src/octave-qt-link.cc @ 25557:bb779fc2d0db

do not attempt to open a file when debugging a command line fct (bug #54231) * octave-qt-link.cc (do_enter_debugger_event): test for function type; if it is command-line then return without action
author Torsten <mttl@mailbox.org>
date Sat, 07 Jul 2018 13:45:16 +0200
parents ab10403a0b50
children bd362df6277c
line wrap: on
line diff
--- a/libgui/src/octave-qt-link.cc	Fri Jul 06 19:20:40 2018 -0400
+++ b/libgui/src/octave-qt-link.cc	Sat Jul 07 13:45:16 2018 +0200
@@ -41,6 +41,8 @@
 #include "interpreter-private.h"
 #include "load-path.h"
 #include "ov.h"
+#include "octave.h"
+#include "oct-map.h"
 #include "symscope.h"
 #include "utils.h"
 
@@ -456,6 +458,16 @@
   void octave_qt_link::do_enter_debugger_event (const std::string& file,
                                                 int line)
   {
+    interpreter& interp = __get_interpreter__ (
+                                  "octave_qt_link::do_enter_debugger_event");
+    octave_value_list fct = F__which__ (interp, ovl (file),0);
+    octave_map map = fct(0).map_value ();
+
+    QString type = QString::fromStdString (
+                    map.contents ("type").data ()[0].string_value ());
+    if (type == QString ("command-line function"))
+      return;
+
     do_insert_debugger_pointer (file, line);
 
     emit enter_debugger_signal ();