bugGNU Octave - Bugs: bug #65617, <F9> clears editor setting...

 
 

bug #65617: <F9> clears editor setting "Always show debug breakpoints and pointers ..."

Submitter:  Philip Nienhuis <philipnienhuis>
Submitted:  Sat 20 Apr 2024 08:53:35 PM UTC
   
 
Category:  GUI Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Other
Status:  Fixed Assigned to:  ttl
Originator Name:  Philip Nienhuis Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Mon 29 Apr 2024 02:22:48 PM UTC, comment #11: 

OK on Windows as well.

Again thank you for the fix!

Closing report.

Philip Nienhuis <philipnienhuis>
Group Member
Mon 29 Apr 2024 02:08:15 PM UTC, comment #10: 

Thanks, on Linux it seems to work. I'll check on Windows in a few minutes.

Philip Nienhuis <philipnienhuis>
Group Member
Sun 28 Apr 2024 07:31:02 PM UTC, comment #9: 

I have pushed cset http://hg.savannah.gnu.org/hgweb/octave/rev/a583e8d66a19 which prevent the temp file from being opened in the editor without changing the user's preferences.

Torsten Lilge <ttl>
Group Member
Fri 26 Apr 2024 04:52:42 AM UTC, comment #8: 

Good point. As far as I remember the active temporary files are listed somewhere in order to clean up at exit in case the temporary file was not removed after its usage correctly. This might be a possibility to check this list before opening the temporary file when debugging with keyboard ().

Torsten Lilge <ttl>
Group Member
Thu 25 Apr 2024 09:43:55 PM UTC, comment #7: 


> when stopping/quitting debugging at the keyboard prompt, the setting won't be restored

All of this should at least be documented somewhere. Or maybe a warning is due.
Until this bug report I really didn't know about this side effect of the <F9>-key, let alone the weaknesses we now know. Maybe there are yet other unforeseen corner cases.

Is unsetting the setting (no pun intended) really the only way to avoid loading the F9 code block file into the editor? Can't the code block file be blacklisted somehow?

Philip Nienhuis <philipnienhuis>
Group Member
Thu 25 Apr 2024 07:52:48 PM UTC, comment #6: 

An error should be okay but quitting the debug really bypasses restoring the settings. As I said, I am currently testing a version where the setting is set to "false" only for the line containing "keyboard". However, when stopping/quitting debugging at the keyboard prompt, the setting won't be restored.

Torsten Lilge <ttl>
Group Member
Thu 25 Apr 2024 07:45:37 PM UTC, comment #5: 


> The change is temporary,

Aha only now I see what you mean. Indeed I noted it when running code blocks that called subfunctions where I had set debug points, but those functions weren't opened in the editor. So what you mean to say is that at the end of debugging that code block, the setting is restored.

Huu that's a sneaky one :-)
It all depends on successfully completing the code in the code block. Which quite isn't guaranteed in all use cases (see below).

> the preference is restored only after the complete block of code that is run by F9

Does this mean that the setting maybe isn't restored if an error occurs in the block of code?
IIRC (I didn't test explicitly) the setting also wasn't restored after clicking the "Stop debugging" button or entering the command 'debug quit'.
Nor after hitting Ctrl-C to end execution of something in the code block (which ends debug mode as well).

Philip Nienhuis <philipnienhuis>
Group Member
Thu 25 Apr 2024 04:49:03 AM UTC, comment #4: 

The change is temporary, but the preference is restored only after the complete block of code that is run by F9. My plan is to change the setting only for the keyboard command using.

Torsten Lilge <ttl>
Group Member
Wed 24 Apr 2024 08:00:12 PM UTC, comment #3: 

(I thought I had commented on this before but it isn't there)

OK, I can follow your logic.
It isn't good that a user setting is silently and definitively affected. IMO even if keyboard() is in the <F9> block this setting should only temporarily be changed. Is a temporary change possible?

BTW the temp file solution for <F9> has other drawbacks as well.
One is that in case of errors in the code block the traceback refers to line numbers in that temp file, not in the code in the editor.
All survivable :-) but at times confusing.

Philip Nienhuis <philipnienhuis>
Group Member
Sun 21 Apr 2024 08:20:24 PM UTC, comment #2: 

This is an intended behavior in order to prevent opening the temporary file with the selected code if keyboard() is included in the selection. But it should be possible to really restrict this to cases where keyboard() is used in the selected code.

Torsten Lilge <ttl>
Group Member
Sun 21 Apr 2024 09:52:41 AM UTC, comment #1: 

Reproducible on Fedora 39 as well.

OS -> Any

Philip Nienhuis <philipnienhuis>
Group Member
Sat 20 Apr 2024 08:53:35 PM UTC, original submission:  

Steps to reproduce:

  1. load debgtst0.m and debgtst1.m in editor
  2. be sure to check in Preferences menu if editor setting "Always show debug breakpoints and pointers (opens related file if closed)" is set
  3. set a breakpoint at L.3 of debgtst1.m
  4. select the only line in debgtst0.m and press F9 key
  5. (execution stops, and L.3 in file debgtst1.m is shown
  6. now again check if editor setting "Always show debug breakpoints and pointers (opens related file if closed)" is set in Preferences menu => in Octave 6.4.0 (oldest I got installed on my laptop) up to dev Octave is is cleared.


So this is quite an old bug.

Currently I just checked on Windows, will check Linux later on.

Philip Nienhuis <philipnienhuis>
Group Member

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #55949:  debgtst0.m added by philipnienhuis (16B - text/plain)
file #55950:  debgtst1.m added by philipnienhuis (98B - text/plain)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by ttl (Posted a comment)
  • -email is unavailable- added by philipnienhuis (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 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-04-29 philipnienhuis StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2024-04-28 ttl StatusNone Ready For Test
    2024-04-21 ttl Assigned toNone ttl
    2024-04-21 philipnienhuis Operating SystemMicrosoft Windows Any
    2024-04-20 philipnienhuis Attached File- Added debgtst0.m, #55949
        Attached File- Added debgtst1.m, #55950

    Back to the top

    Powered by Savane 3.13-bb6a.
    Corresponding source code