bugGNU Octave - Bugs: bug #38953, Feature request: list command for...

 
 

bug #38953: Feature request: list command for debugger

Submitted by:  None
Submitted on:  Thu 09 May 2013 04:51:40 PM UTC  
 
Category: InterpreterSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Feature Request
Status: FixedAssigned to: None
Originator Name: Charles FoxOriginator Email: -unavailable-
Open/Closed: ClosedRelease: 3.2.0
Operating 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.

 

Wed 26 Jun 2013 01:35:33 PM UTC, comment #4:

Thanks very much for this Rik -- I've just upgraded to the latest svn and this dblist command is going to revolutionize my stepping though other people's code!

(Having just the next executable line there was good for debugging my own code, but I mostly use the debugger to help understand/reverse engineer large uncommented research code bases written by others, where it's good to see the whole algorithm and step though it to watch what it does.)

Charles

Charles Fox <charlesfox>
Tue 25 Jun 2013 03:07:19 AM UTC, comment #3:

I added a dblist command in this changeset (http://hg.savannah.gnu.org/hgweb/octave/rev/035b5fe157ad). Closing report.

Rik <rik5>
Project Administrator
Wed 19 Jun 2013 12:40:08 AM UTC, comment #2:

I would strongly suggest upgrading to the current stable version of Octave. Version 3.2.0 is deprecated and very out of date.

The current debugger behavior is to print out the line number and code of the next executable line whenever the debug prompt is triggered. Thus, you can see where you are and what will be executed by the next dbstep command without having to use dbwhere and dbtype.

If you are feeling more experimental the development version of Octave has a GUI with integrated debugging very similar to Matlab.

Rik <rik5>
Project Administrator
Sat 11 May 2013 04:51:47 PM UTC, comment #1:

Debug code is generally in libinterp/interpfcn/debug.cc. There has been a lot of recent activity related to breakpoints:

http://hg.savannah.gnu.org/hgweb/octave/rev/645672f1c873
http://hg.savannah.gnu.org/hgweb/octave/rev/de91b1621260

Become familiar with the code and coordinate with John to make sure time is invested in a good direction. In fact, you may want to open such a feature for discussion on the maintainers list.

Dan Sebald <sebald>
Thu 09 May 2013 04:51:40 PM UTC, original submission:

I'm stepping through someone else's code to try to understand what it's doing. In Matlab-like environments this is easy, the keys F9-F11 give step commands, and the current position and stack is displayed in the GUI. Doing this in Octave is clunkier, I have do keep typing dbwhere to get the line number, reading it manually, and re-typing it into the list command to see the code. (And even then it doesn't show the current line).

I would like to suggest a command line debugger feature similar to gdb where the user can type a single letter 'l' (for list) and have the interpreter show the 10 lines around the current line, with an arrow marking the current line. (It could also allow "l 20" to specify how many lines to print). This would only take a few minutes to implement but would speed up my code reading by a factor of 10s or probably 100s.

(A more heavyweight solution would be to have the debugger expose its own internals as an octave struct, like in the python pdb debugger. Then the user could write her own functions like
function mydblist()
currentline = theDebugger.lineNo
currentfunctionfile = theDebugger.currentFunctionFile
%read and print lines from file
this would probably be a much bigger job to implement but would allow different users to write all kinds of useful debug macros and share them.)

I could maybe have a go at a patch for the lightweight version myself if one of the octave devs could give me a few pointers about where to look in the code? (I wrote some similar mods for the python debugger, but it's code is probably a lot easier to read than octave's.)

Anonymous

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 25 Jun 2013 03:07:19 AM UTCrik5StatusNone=>Fixed
      Open/ClosedOpen=>Closed
    Wed 19 Jun 2013 12:40:40 AM UTCrik5SummaryFeature request: improvements to command line debugger=>Feature request: list command for debugger

    Back to the top


    Powered by Savane 3.1-cleanup