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: InterpreterSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: None
Originator Name: Richard CrozierOpen/Closed: Closed
Release: devOperating System: GNU/Linux

Add a New Comment (Rich MarkupRich 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

debug_on_warning(true)

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

However, when I then set

debug_on_warning(0)

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

dbstepouttesthighlevel.m
dbstepoutlowlevel.m

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 File(s):
   
   
Comment:
   

Attached Files
file #26878:  patch.warn_on_debug added by rik5 (1kB - 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
  • -unavailable- added by rik5 (Updated the item)
  • -unavailable- added by rik5
  • -unavailable- added by crobar (Submitted the item)
  •  

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

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 7 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 08 May 2014 09:52:04 PM UTCrik5StatusNone=>Fixed
      Open/ClosedOpen=>Closed
    Mon 05 Nov 2012 05:10:22 PM UTCrik5Attached File-=>Added patch.warn_on_debug, #26878
    Mon 05 Nov 2012 04:54:01 PM UTCrik5Carbon-Copy-=>Added jwe
    Mon 15 Oct 2012 10:01:16 AM UTCcrobarAttached 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.1-cleanup