diff libinterp/corefcn/debug.cc @ 25347:af3319d86a5f

eliminate some global references to interpreter internals * bp-table.h, bp-table.cc (bp_table::m_interpreter): New data member. (get_user_code): Deprecate. * interpreter.h, interpreter.cc (interpreter::get_user_code): New function. Change all uses of global get_uesr_code to use interpreter::get_user_code instead.
author John W. Eaton <jwe@octave.org>
date Thu, 03 May 2018 16:04:53 -0400
parents dd416c31761e
children bc5f225bc578
line wrap: on
line diff
--- a/libinterp/corefcn/debug.cc	Thu May 03 02:26:29 2018 -0400
+++ b/libinterp/corefcn/debug.cc	Thu May 03 16:04:53 2018 -0400
@@ -390,7 +390,7 @@
 /*
       if (Vdebugging)
         {
-          octave_user_code *dbg_fcn = get_user_code ();
+          octave_user_code *dbg_fcn = interp.get_user_code ();
           if (dbg_fcn)
             {
               symbol_name = dbg_fcn->name ();
@@ -538,7 +538,7 @@
 @seealso{dbstack, dblist, dbstatus, dbcont, dbstep, dbup, dbdown}
 @end deftypefn */)
 {
-  octave_user_code *dbg_fcn = octave::get_user_code ();
+  octave_user_code *dbg_fcn = interp.get_user_code ();
 
   if (! dbg_fcn)
     {
@@ -607,8 +607,8 @@
   os.flush ();
 }
 
-DEFUN (dbtype, args, ,
-       doc: /* -*- texinfo -*-
+DEFMETHOD (dbtype, interp, args, ,
+           doc: /* -*- texinfo -*-
 @deftypefn  {} {} dbtype
 @deftypefnx {} {} dbtype @var{lineno}
 @deftypefnx {} {} dbtype @var{startl:endl}
@@ -638,7 +638,7 @@
   switch (args.length ())
     {
     case 0:  // dbtype
-      dbg_fcn = octave::get_user_code ();
+      dbg_fcn = interp.get_user_code ();
 
       if (! dbg_fcn)
         error ("dbtype: must be inside a user function to give no arguments to dbtype\n");
@@ -656,7 +656,7 @@
 
         if (ind != std::string::npos)  // (dbtype start:end)
           {
-            dbg_fcn = octave::get_user_code ();
+            dbg_fcn = interp.get_user_code ();
 
             if (dbg_fcn)
               {
@@ -686,7 +686,7 @@
 
             if (line == 0)  // (dbtype func)
               {
-                dbg_fcn = octave::get_user_code (arg);
+                dbg_fcn = interp.get_user_code (arg);
 
                 if (! dbg_fcn)
                   error ("dbtype: function <%s> not found\n", arg.c_str ());
@@ -699,7 +699,7 @@
                 if (line <= 0)
                   error ("dbtype: start and end lines must be >= 1\n");
 
-                dbg_fcn = octave::get_user_code ();
+                dbg_fcn = interp.get_user_code ();
 
                 if (dbg_fcn)
                   do_dbtype (octave_stdout, dbg_fcn->fcn_file_name (),
@@ -711,7 +711,7 @@
 
     case 2:  // (dbtype func start:end) || (dbtype func start)
       {
-        dbg_fcn = octave::get_user_code (argv[1]);
+        dbg_fcn = interp.get_user_code (argv[1]);
 
         if (! dbg_fcn)
           error ("dbtype: function <%s> not found\n", argv[1].c_str ());
@@ -784,7 +784,7 @@
         error ("dblist: N must be a non-negative integer");
     }
 
-  octave_user_code *dbg_fcn = octave::get_user_code ();
+  octave_user_code *dbg_fcn = interp.get_user_code ();
 
   if (! dbg_fcn)
     error ("dblist: must be inside a user function to use dblist\n");