diff src/input.cc @ 5743:a527e0f77aa5

[project @ 2006-04-06 08:20:21 by jwe]
author jwe
date Thu, 06 Apr 2006 08:20:23 +0000
parents 426719471ac6
children 1c36a2e82266
line wrap: on
line diff
--- a/src/input.cc
+++ b/src/input.cc
@@ -545,18 +545,20 @@
   std::string nm;
   int line = -1;
 
-  // We look at curr_caller_function because curr_function is always
-  // "keyboard".
-
-  if (debug && curr_caller_function)
+  if (debug)
     {
-      nm = curr_caller_function->fcn_file_name ();
+      octave_user_function *caller = octave_call_stack::caller_script ();
+
+      if (caller)
+	{
+	  nm = caller->fcn_file_name ();
 
-      if (nm.empty ())
-	nm = curr_caller_function->name ();
+	  if (nm.empty ())
+	    nm = caller->name ();
 
-      if (curr_statement)
-	line = curr_statement->line ();
+	  if (curr_statement)
+	    line = curr_statement->line ();
+	}
     }
 
   OSSTREAM buf;
@@ -634,7 +636,7 @@
 
 	      tree::last_line = 0;
 
-	      tree::break_function = curr_function;
+	      tree::break_function = octave_call_stack::current ();
 
 	      return retval;
 	    }
@@ -644,7 +646,7 @@
 
 	      tree::last_line = curr_statement->line ();
 
-	      tree::break_function = curr_function;
+	      tree::break_function = octave_call_stack::current ();
 
 	      return retval;
 	    }