bugGNU Octave - Bugs: bug #49068, Cannot set breakpoints in...

 
 

bug #49068: Cannot set breakpoints in subfunctions from GUI editor when not using "endfunction" keyword

Submitter:  Guillaume <gyom>
Submitted:  Mon 12 Sep 2016 12:39:46 PM UTC
   
 
Category:  GUI Severity:  2 - Minor
Priority:  3 - Low Item Group:  Incorrect Result
Status:  Confirmed Assigned to:  None
Originator Name:  Guillaume Open/Closed:  * Open
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Sun 03 Mar 2019 04:57:50 PM UTC, comment #7: 

Yes, still reproducible with 5.1 or on the development branch.

Mike Miller <mtmiller>
Group Member
Sun 03 Mar 2019 07:34:12 AM UTC, comment #6: 

Is this still a problem with the new 5.1.0 release?

Rik <rik5>
Group administrator
Tue 13 Sep 2016 10:17:18 AM UTC, comment #5: 

Setting a breakpoint from the command line indeed works fine, thanks for pointing it out. It seems necessary to specify the name of the subfunction though: ie it works with "dbstop test_breakpoint>bbbb 8" but not with "dbstop test_breakpoint 8".

Also, I cannot back it up by any number but I would guess that the majority of Matlab code around doesn't have an "end" keyword at the end of functions or subfunctions, given that it only became relevant with the (more recent) introduction of nested functions.

Guillaume <gyom>
Mon 12 Sep 2016 05:08:33 PM UTC, comment #4: 

Easy workarounds are to use the "end" or "endfunction" keyword always, or to set breakpoints from the command window, after which they will be marked correctly as being set in the editor window.

Mike Miller <mtmiller>
Group Member
Mon 12 Sep 2016 05:07:07 PM UTC, comment #3: 

Sorry, you are probably right, I have no idea about undocumented Matlab shortcut syntaxes.

Anyway, yes I see the same thing, and it is only limited to the GUI editor, only on the second or further down subfunction, and only when using this no-end-keyword shortcut syntax. Setting a breakpoint from the command line with "dbstop test_breakpoint>bbbb 8" works fine. This is strictly limited to the editor interface.

Mike Miller <mtmiller>
Group Member
Mon 12 Sep 2016 04:36:02 PM UTC, comment #2: 

Apologies in advance if I'm embarrassingly wrong but I thought that in my example the functions aaaa() and bbbb() where subfunctions and not nested functions. I.e. this is equivalent to this:


function test_breakpoint
disp('test_breakpoint');
end

function aaaa
disp('aaaa');
end

function bbbb
disp('bbbb');
end


while a nested function example would be:


function test_breakpoint
disp('test_breakpoint');

function aaaa
disp('aaaa');
end

function bbbb
disp('bbbb');
end

end


Guillaume <gyom>
Mon 12 Sep 2016 04:29:08 PM UTC, comment #1: 

Confirmed, this is a known limitation of the interpreter as well, see bug #47917. These are nested functions, btw. If you add "end" or "endfunction", they become subfunctions (Matlab calls them "local functions").

I'll leave this open in case some GUI work needs to be done once the interpreter supports setting breakpoints in nested functions.

Mike Miller <mtmiller>
Group Member
Mon 12 Sep 2016 12:39:46 PM UTC, original submission:  

In the following example (file test_breakpoint.m) of 8 lines, I can only set a breakpoint to lines 2, 3, 5, 6 but not 8 (ie in the second subfunction) when using the build-in editor:


function test_breakpoint
disp('test_breakpoint');

function aaaa
disp('aaaa');

function bbbb
disp('bbbb');


If 'endfunction' statements are added to each function, it works.

Guillaume <gyom>

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Digest:
   bug dependencies.

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by gyom (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 9 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-03-03 mtmiller Priority5 - Normal 3 - Low
    2019-03-03 mtmiller Carbon-CopyRemoved 80942 -
    2016-09-12 mtmiller Severity3 - Normal 2 - Minor
        StatusPostponed Confirmed
        SummaryCannot set breakpoints in nested functions from GUI editor Cannot set breakpoints in subfunctions from GUI editor when not using "endfunction" keyword
    2016-09-12 mtmiller SummaryCannot set breakpoints in subfunctions Cannot set breakpoints in nested functions from GUI editor
    2016-09-12 mtmiller Item GroupNone Incorrect Result
        StatusNone Postponed
        Dependencies- Depends on bugs #47917

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code