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

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

[Octave-bug-tracker] [bug #47917] dbstop skips nested functions


From: Lachlan Andrew
Subject: [Octave-bug-tracker] [bug #47917] dbstop skips nested functions
Date: Fri, 13 May 2016 23:39:42 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:43.0) Gecko/20100101 Firefox/43.0

URL:
  <http://savannah.gnu.org/bugs/?47917>

                 Summary: dbstop skips nested functions
                 Project: GNU Octave
            Submitted by: lachlan
            Submitted on: Fri 13 May 2016 11:39:39 PM GMT
                Category: Interpreter
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: Lachlan
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: dev
        Operating System: GNU/Linux

    _______________________________________________________

Details:

To reproduce this bug, create the file nested.m containing


function nested
  a = 1;

  function inner
    b = 2;
  end

  d = 3;

end

function subfunction

  c = 3;
end


and issue the command


dbstop nested 1 4 7 11


The results should be 2 5 8 14, but instead is 2 8 8 0.

The reason is that add_breakpoint stops once it reaches a (sub)function
containing a line number at least equal to the requested line.  That means it
can only set breakpoints in a single (sub)function per invocation.

More importantly, because the "end" of an outer function is processed before a
nested function is, breakpoints cannot be set in nested functions at all.

I'll post a patch once I have a bug number.  It first checks which
(sub)function contains each requested line, and then walks only the selected
function.




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?47917>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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