octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #55178] Improved debug on error behaviour insi


From: John W. Eaton
Subject: [Octave-bug-tracker] [bug #55178] Improved debug on error behaviour inside octave core functions
Date: Tue, 9 Nov 2021 13:13:47 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0

Follow-up Comment #15, bug #55178 (project octave):

Since debug_on_error only stops when executing interpreted code, I was
thinking that maybe the best solution was to make print_usage a built-in
function.  Then calling it would behave the same as calling error.  But then I
remembered that we can use


debug_on_error (true, "local");


to temporarily set the value of debug_on_error inside a function.  So if we do
that inside the print_usage function, I think we'll get the desired behavior. 
Can you try the following change and see whether it does what you expect?


diff --git a/scripts/help/print_usage.m b/scripts/help/print_usage.m
--- a/scripts/help/print_usage.m
+++ b/scripts/help/print_usage.m
@@ -82,6 +82,7 @@ function print_usage (name)
     warning ("print_usage: raw Texinfo source of help text follows...\n");
   endif
 
+  debug_on_error (false, "local");
   if (at_toplev)
     error ("Octave:invalid-fun-call",
            "Invalid call to %s.  Correct usage is:\n\n%s\n%s",


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?55178>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]