bugGNU Octave - Bugs: bug #37574, odd behaviour of dbstep out


bug #37574: odd behaviour of dbstep out

Submitted by:  Richard <crobar>
Submitted on:  Mon 15 Oct 2012 10:01:16 AM UTC  
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Richard Crozier Open/Closed:  Closed
Release:  dev Operating System:  GNU/Linux

Add a New Comment (Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Thu 08 May 2014 09:52:04 PM UTC, comment #2: 

I fixed both debug_on_warning() and debug_on_error() which were only entering the debug state for a single statement.  See (http://hg.savannah.gnu.org/hgweb/octave/rev/bd334b6af257).  This will be a part of the 4.2 release of Octave.

Rik <rik5>
Project Administrator
Mon 05 Nov 2012 05:10:22 PM UTC, comment #1: 

The issue that you identified is actually something of a definitional one.  When using debug_on_warning/debug_on_error Octave makes the assumption that you want a one-shot breakpoint.  It assumes that if you get an error, and drop into the debugger prompt, that the only useful thing to do is inspect variables.  Presumably, the error was significant enough that continuing, by using dbstep, is not a real possibility so it treats it as dbcont and returns to the Octave prompt.

This might make sense for debug_on_error, but probably doesn't need to be interpreted so rigidly for debug_on_warning.  I've attached a patch where I simply copied the code for the keyboard command into the debug_on_warning code where it calls do_keyboard().  This works except for one small detail.  An unwind protect frame is set up and the variable debug_on_warning() is set to false, presumably to avoid recursion.  When in the debugger, the variable is false the first time the debug prompt is encountered.  But after any continuation command, such as dbstep, it reverts back to the previous value.  I'm hoping that jwe can instantly pick out why that is so and knows a fix for it.

(file #26878)

Rik <rik5>
Project Administrator
Mon 15 Oct 2012 10:01:16 AM UTC, original submission:  

Consider the behaviour shown in the set of attached files related to dbstep out.

When I set


and am stopped on a warning statement running "dbstep out" acts like dbcont. This is an issue in itself.

However, when I then set


and add a breakpoint, the debugger does not stop in the function with the break point, but instead acts as though I have called dbstep out immediately on entering debug mode already and is stopped in the higher level function.

It is best demonstrated in the supplied example which consists of three files, the two function files


and a script dbstep_out_test.m which calls dbstepouttesthighlevel to demonstrate the issue.

Richard <crobar>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

Attached Files
file #26878:  patch.warn_on_debug added by rik5 (1KiB - application/octet-stream)
file #26765:  dbstep_out_test.m added by crobar (433B - text/x-objcsrc)
file #26766:  dbstepouttesthighlevel.m added by crobar (164B - text/x-objcsrc)
file #26767:  dbstepoutlowlevel.m added by crobar (170B - text/x-objcsrc)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by rik5 (Updated the item)
  • -email is unavailable- added by rik5
  • -email is unavailable- added by crobar (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.




    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-05-08 rik5 StatusNone => Fixed
        Open/ClosedOpen => Closed
    2012-11-05 rik5 Attached File- => Added patch.warn_on_debug, #26878
    2012-11-05 rik5 Carbon-Copy- => Added jwe
    2012-10-15 crobar Attached File- => Added dbstep_out_test.m, #26765
        Attached File- => Added dbstepouttesthighlevel.m, #26766
        Attached File- => Added dbstepoutlowlevel.m, #26767

    Back to the top

    Powered by Savane 3.5