diff libinterp/octave-value/cdef-class.cc @ 26975:de826e69a5ea

make breakpoints in classdef methods work (bug #45404, bug #46451) * bp-table.h, bp-table.cc (bp_table::add_breakpoint): New argument, CLASS_NAME. Change all uses. Pass class name on to tree_evaluator::get_user_code. * cdef-class.h, cdef-class.cc (cdef_class::get_method, cdef_class::cdef_class_rep::get_method): New functions. * cdef-manager.h, cdef-manager.cc (cdef_manager::find_method): New function. * pt-eval.h, pt-eval.cc (tree_evaluator::get_user_code): New argument, CLASS_NAME. If given class name, look for classdef methods.
author John W. Eaton <jwe@octave.org>
date Tue, 26 Mar 2019 02:42:38 +0000
parents fbb318c371db
children c776d553c19e
line wrap: on
line diff
--- a/libinterp/octave-value/cdef-class.cc	Mon Mar 25 13:59:41 2019 -0700
+++ b/libinterp/octave-value/cdef-class.cc	Tue Mar 26 02:42:38 2019 +0000
@@ -703,6 +703,18 @@
   }
 
   octave_value
+  cdef_class::cdef_class_rep::get_method (const std::string& name) const
+  {
+    auto p = method_map.find (name);
+
+    if (p == method_map.end ())
+      return octave_value ();
+
+    return p->second.get_function ();
+  }
+
+
+  octave_value
   cdef_class::cdef_class_rep::construct (const octave_value_list& args)
   {
     cdef_object obj = construct_object (args);