bugGNU Octave - Bugs: bug #50312, dbstep fails when combined with...

 
 

bug #50312: dbstep fails when combined with another command: "dbstep; cmd2"

Submitter:  nicodemus <nicmus>
Submitted:  Wed 15 Feb 2017 10:59:15 AM UTC
   
 
Category:  Interpreter Severity:  2 - Minor
Priority:  3 - Low Item Group:  Incorrect Result
Status:  Confirmed Assigned to:  None
Originator Name:  Open/Closed:  * Open
Release:  * 4.2.0 Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 16 Feb 2017 05:24:19 PM UTC, comment #2: 

Changing the priority to Low.  The debug path is only occasionally used so it makes more sense to spend time fixing bugs on the default execution path.  And there is an easy workaround of using just one dbnext command per line.

When it comes to debugging this, the issue is the dbnext command itself.  It wants to stop after every single command execution. 

For example,


octave:1> dbstop test 3
ans =  3
octave:2> test
stopped in /home/rik/wip/Projects_Mine/octave-dev/test.m at line 3
3: disp 'hello world 3';
hello world 1
hello world 2
debug> dbnext; sin (1)
stopped in /home/rik/wip/Projects_Mine/octave-dev/test.m at line 1
1: disp 'hello world 1';
debug> dbnext
stopped in /home/rik/wip/Projects_Mine/octave-dev/test.m at line 4
4: disp 'hello world 4';
ans =  0.84147
hello world 3


As you can see, the debugger stops in the middle of the pipeline "cmd1; cmd2".  If I use dbnext once more in this intermediate context then it executes cmd2 (sin (1)) and then line 3 from the script.

Obviously the Octave parser is confused about what stack frame it is located in.  If I use the command "dbnext; dbnext" you might think that from the example above it would halt after the first "dbnext", and that typing "dbnext" would cause it to execute the second half.  Instead, there is as an error issued.


octave:3> test
stopped in /home/rik/wip/Projects_Mine/octave-dev/test.m at line 3
3: disp 'hello world 3';
hello world 1
hello world 2
debug> dbnext; dbnext
stopped in /home/rik/wip/Projects_Mine/octave-dev/test.m at line 1
1: disp 'hello world 1';
debug> dbnext
error: dbstep: can only be called in debug mode
error: called from
    test at line 1 column 9
stopped in /home/rik/wip/Projects_Mine/octave-dev/test.m at line 4
4: disp 'hello world 4';
hello world 3



Rik <rik5>
Group administrator
Wed 15 Feb 2017 05:48:52 PM UTC, comment #1: 

Confirmed here when using dbstep on the same line as another debug command. This goes back to at least version 3.8, this is not a recent change.

Easy workaround is to not use more than one debugging command per entry at the debug prompt.

Mike Miller <mtmiller>
Group Member
Wed 15 Feb 2017 10:59:15 AM UTC, original submission:  

Hi when I run the debug octave --no-gui console a strange behaviour shows up by concatanating dbstep and other commands.

Here is an example which best explain the problem


% FILE: test.m
disp 'hello world 1';
disp 'hello world 2';
disp 'hello world 3';
disp 'hello world 4';
disp 'hello world 5';

>> dbstop test 3;

>> test
hello world 1
hello world 2
stopped in test.m at line 3
3: disp 'hello world 3';

>> dbstep; dblist
stopped in test.m at line 1
1: disp 'hello world 1';

>> dbstep; dblist
stopped in test.m at line 1
1: disp 'hello world 1';

>> dbstep;
1-->    disp 'hello world 1';
2       disp 'hello world 2';
3       disp 'hello world 3';
4       disp 'hello world 4';
5       disp 'hello world 5';
1-->    disp 'hello world 1';
2       disp 'hello world 2';
3       disp 'hello world 3';
4       disp 'hello world 4';
5       disp 'hello world 5';
hello world 3
stopped in test.m at line 4
4: disp 'hello world 4';

>> dbstep
hello world 4
stopped in test.m at line 5
5: disp 'hello world 5';

>> dbstep
hello world 5
stopped in test.m at line 6
6:

>> dbstep
% end debug


nicodemus <nicmus>

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

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 mtmiller (Posted a comment)
  • -email is unavailable- added by nicmus (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 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-02-16 rik5 Summarydebug: combining dbstep and dblist dbstep fails when combined with another command: "dbstep; cmd2"
    2017-02-16 rik5 Severity3 - Normal 2 - Minor
        Priority5 - Normal 3 - Low
    2017-02-15 mtmiller Item GroupSegfault, Bus Error, etc. Incorrect Result
        StatusNone Confirmed

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code