bugGNU Octave - Bugs: bug #42705, Commands continue to be sent to...

 
 

bug #42705: Commands continue to be sent to the terminal if breakpoint hit

Submitted by:  Richard <crobar>
Submitted on:  Tue 08 Jul 2014 12:54:49 PM UTC  
 
Category: GUISeverity: 3 - Normal
Priority: 5 - NormalItem Group: Other
Status: NoneAssigned to: None
Originator Name: Richard CrozierOpen/Closed: Open
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.

 

(Jump to the original submission Jump to the original submission)

Wed 30 Jul 2014 05:43:02 PM UTC, comment #6:

You can't find the line in the sources. This would be the solution where all selected text is evaluated as one text block in the terminal. Please find attached the diff to the actual version.

(file #31801)

Torsten <ttl>
Project Member
Wed 30 Jul 2014 02:04:58 PM UTC, comment #5:

Sorry, typo:

Richard <crobar>
Wed 30 Jul 2014 02:03:50 PM UTC, comment #4:

Sorry, I'm still not sure about this. I don't see the line you quote anywhere in the sources:

++verbatib++
rcrozier@crozier-laptop ~/src/octave-src $ grep -rnI execute_command_in_terminal_signal .
./libgui/src/octave-qt-link.h:159: void execute_command_in_terminal_signal (const QString& command);
./libgui/src/octave-qt-link.cc:359: emit execute_command_in_terminal_signal (QString::fromStdString (command));
./libgui/src/m-editor/moc-file-editor.cc:212: "execute_command_in_terminal_signal(QString)\0"
./libgui/src/m-editor/moc-file-editor.cc:338: case 41: _t->execute_command_in_terminal_signal((reinterpret_cast< const QString()>(_a[1]))); break;
./libgui/src/m-editor/moc-file-editor.cc:719:void file_editor::execute_command_in_terminal_signal(const QString & _t1)
./libgui/src/m-editor/file-editor-tab.cc:87: SIGNAL (execute_command_in_terminal_signal (const QString&)),
./libgui/src/m-editor/file-editor-tab.cc:204: emit execute_command_in_terminal_signal (command); // connected to main window
./libgui/src/m-editor/octave-qscintilla.h:52: void execute_command_in_terminal_signal (const QString&);
./libgui/src/m-editor/file-editor-tab.h:135: void execute_command_in_terminal_signal (const QString&);
./libgui/src/m-editor/octave-qscintilla.cc:262: emit execute_command_in_terminal_signal (command + _word_at_cursor);
./libgui/src/m-editor/octave-qscintilla.cc:268: emit execute_command_in_terminal_signal (QString("edit ") + _word_at_cursor);
./libgui/src/m-editor/octave-qscintilla.cc:277: emit execute_command_in_terminal_signal (commands.at (i));
./libgui/src/m-editor/moc-file-editor-tab.cc:125: "execute_command_in_terminal_signal(QString)\0"
./libgui/src/m-editor/moc-file-editor-tab.cc:205: case 7: _t->execute_command_in_terminal_signal((reinterpret_cast< const QString()>(_a[1]))); break;
./libgui/src/m-editor/moc-file-editor-tab.cc:364:void file_editor_tab::execute_command_in_terminal_signal(const QString & _t1)
./libgui/src/m-editor/moc-octave-qscintilla.cc:54: "execute_command_in_terminal_signal(QString)\0"
./libgui/src/m-editor/moc-octave-qscintilla.cc:70: case 0: _t->execute_command_in_terminal_signal((reinterpret_cast< const QString()>(_a[1]))); break;
./libgui/src/m-editor/moc-octave-qscintilla.cc:125:void octave_qscintilla::execute_command_in_terminal_signal(const QString & _t1)
./libgui/src/m-editor/file-editor.h:114: void execute_command_in_terminal_signal (const QString&);
./libgui/src/m-editor/file-editor.cc:189: emit execute_command_in_terminal_signal ("edit " + new_name);
./libgui/src/m-editor/file-editor.cc:1409: connect (this, SIGNAL (execute_command_in_terminal_signal (const QString&)),
./libgui/src/m-editor/file-editor.cc:1465: connect (f, SIGNAL (execute_command_in_terminal_signal (const QString&)),
./libgui/src/moc-octave-qt-link.cc:65: "command\0execute_command_in_terminal_signal(QString)\0"
./libgui/src/moc-octave-qt-link.cc:91: case 4: _t->execute_command_in_terminal_signal((reinterpret_cast< const QString()>(_a[1]))); break;
./libgui/src/moc-octave-qt-link.cc:179:void octave_qt_link::execute_command_in_terminal_signal(const QString & _t1)
./libgui/src/main-window.cc:1372: SIGNAL (execute_command_in_terminal_signal (QString)),
./.hg/merge/f886cf611844ebec7c8dd6e7a740454c68353356:189: emit execute_command_in_terminal_signal ("edit " + new_name);
./.hg/merge/f886cf611844ebec7c8dd6e7a740454c68353356:1405: connect (this, SIGNAL (execute_command_in_terminal_signal (const QString&)),
./.hg/merge/f886cf611844ebec7c8dd6e7a740454c68353356:1461: connect (f, SIGNAL (execute_command_in_terminal_signal (const QString&)),
--verbatim--

I'm on the gui-release branch hg id returns: 12462638ab20+ (gui-release) tip

Richard <crobar>
Mon 21 Jul 2014 04:48:13 AM UTC, comment #3:

With comment #1 I wanted to say that if the selection is not split into single lines but sent as one text block to the terminal, i.e.

only the part before the first newline is evaluated. Your example then leads to

and y is not evaluated:

Torsten <ttl>
Project Member
Sun 20 Jul 2014 11:15:53 PM UTC, comment #2:

I'm not sure what you mean by this? If I highlight the following in the editor and do 'Run Selection', all lines are sent to the terminal.

i.e. I get the following output:

This is what I expect since as per the followng code in octave_qscintilla.cc

Richard <crobar>
Sun 20 Jul 2014 08:17:17 PM UTC, comment #1:

When sending all text as one block, only the part before the first newline is evaluated.

Torsten <ttl>
Project Member
Tue 08 Jul 2014 12:54:49 PM UTC, original submission:

If you use 'Run Selection' to send commands to the command window, and one of those commands results in you hitting a break point in your code, flow stops at the break point, but the remaining commands then continue to be sent to the terminal, usually resulting in an error.

It would be better in general if commands sent in this way acted as a single 'block' sent to the interpreter (as though they were in a script file).

Might this also avoid the painfully slow printing of the commands on the GUI terminal when using 'Run Selection' too?

Looking into the code (octave_qscintilla.cc around line 244) I see that the command is split on [\r\n] and fed line by line to the octave link. Is the Octave interpreter unable to accept newlines in its input?

I'm on the default branch hg id returns: 24332f256940 tip @

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 #31801:  execute_selected_text.diff added by ttl (618B - text/x-diff)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by ttl (Posted a comment)
  • -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):

     

     

    Follows 1 latest change.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 30 Jul 2014 05:43:02 PM UTCttlAttached File-=>Added execute_selected_text.diff, #31801

    Back to the top


    Powered by Savane 3.1-cleanup