What does 'Set Next Statement' button do in PyDev? - eclipse

The button is shown in the debug view toolbar only (simple left-to-right arrow), not in the main toolbar. The action is mentioned in Debugger auto reload documentioan but there is no documentation about it in either Eclipse or PyDev documentation. Also, it is always disabled when code editor is in-focus.
I was actually looking for the Run To Line action which has no button in the PyDev debug view but I found that the shortcut (ctrl-R) works despite that the button is hidden.

It should be enabled in the debug view.
The Set Next Statement will set the next line to execute. It must be inside the same context (i.e.: same method and if inside a try..except it has to be inside that same try clause -- this is a Python limitation).
So, if you want in a debug session and you're in the middle of a function, you can just use the set next statement to be a different place, such as the start of your function.

There is perhaps a little more information on the pydev code mailing list:
We propose to add a new debugging feature in PyDev i.e. 'Set Next
Statement' wherein we will prevent the 'Set Next' target to be within
a 'For' or 'While' loop.

Related

How to wrap line in PyDev's interactive console?

Each time I want to view a long output line, I have to drag the horizontal scroll bar. Is it possible to set word wrapping in PyDev's interactive console (not editor)?
Unfortunately no, it's not currently possible to enable word wrapping in the PyDev interactive console.
You may report this as a feature request in https://www.brainwy.com/tracker/PyDev (but even better would be providing a pull request for that -- see: http://www.pydev.org/developers.html)
It is now possible as of PyDev 6.2. By default it is not enabled. To see the icon that you have to click to enable visit this. For the possibility that the link disappears, go to the console tab and you will want to look for an icon which has a yellow "left-turn" arrow and click that.

MATLAB: set keyboard shortcut to go to line where current code execution stopped

I would like to set a key short-cut. e.g. ctrl+1 or so, to go in the editor into the file and line where the 'keyboard' command stopped the current code execution in order to debug faster. Is this possible? Or does it exist already? Now, even when I click the function in the debugger tab, it doesn't go there if that function was last clicked and in the mean time you moved manually to another function in the editor. I first have to click another function in the pop down menu and than re-click to function I want to go to. Very annoying.

why can't I set up a breakpoint in eclipse?

For some odd reason, I can't use breakpoints in my eclipse project. All breakpoints that I set have a diagonal line on them, above the dot in the respective line (on the left margin of the window), as if they are blocked. When I run in debug mode, the breakpoints are ignored. Any ideas?
You've probably just pressed "Skip All Breakpoints" in the Breakpoint view - simply press it again.
Default key bindings are: Ctrl + Alt + B.
This doesn't exactly answer the OPs question, but when trying to double click to add break points, I was getting messages stating "this feature is not enabled".
I had to right click on the break point bar and select "Breakpoint Types" -> "C/C++ Breakpoints" instead of "Default". Then it worked fine.
in python, I had to go to:
windows->perspective->Open Perspective->Debug
then select the Breakpoints tab and make sure the zero with the slash (skip all breakpoints) is not selected (you can also use Ctrl-Alt-B to toggle it).
Open Debug View
Open Breakpoint Perspective
Right-click all breakpoints there
Press Enable
My "toggle breakpoint" and other menu options were disabled. I restarted Eclipse (Kepler SR1) and they came back enabled. I could set breakpoints again!
In my case, I'd edited my code during debugging, adding a null-check so I could place a breakpoint to stop execution only when a certain value was null. I couldn't add a breakpoint because the line of code in question was not present in the running application.
In Java, certain code changes can be woven in as soon as the file is saved, so in my case, remembering to save the changes was enough to enable placing a breakpoint.
For changes that can't be woven in, the application must be restarted before the new lines of code will be present.
In my case, I opened up the Breakpoints view, clicked 'remove all breakpoints' and then toggled the 'skip all breakpoints' option off, then on. This allowed me to set breakpoints again. This was after a restart of eclipse failed to help.
I was having a simular issue, for me the standard code-editor changed after installing a new plugin from Marketplace. Apparently the Plugin thought to change the default-editor for a lot of file-types, not only the one I installed it for. The new editor did not allow setting breakpoints but I hadn't known it changed at the time. When I right-clicked my source-file in the Project-explorer I saw under open-with the new editor listed on top. When I opened with the previous editor, everything went back to normal.

immediate window

Is there anyplace in the eclipse ide that I can enter immediate code while stoped at a breakpoint?
thanks
It's called the Display window in Eclipse. Menu Item: Window/Show View/Display
To run command you need to type then select the text in the display window and select one of the two J icons in the window.
Note: as mentioned in Debugging with the Eclipse Platform, you can use the Display View to scrapbook your live code.
Meaning, while you have a live debug session:
, you can run/debug some expressions or code in a Display view:
Example:
See My favorite Eclipse view
To execute the code and display the returned value, push the button with a "J":
If you just want to execute some code that doesn't return a value, push the button with an arrow ">" and a "J":
The standard output will be printed to the Console view.

How to Display Current Function in Eclipse

I miss a certain functionality in Eclipse. I would like to know the name of the current function the cursor is currently inside. This is useful when browsing unknown code using the search function, for example.
Any idea how to show it? Maybe a plugin?
I'm using the "Toggle Breadcrumb" option from toolbar:
It shows a nice breadcrumb, ending with current function name.
It's quite handy for me, as Outline becomes cumbersome to use if you have zilions of functions.
It produces the following structure above your Java Editor (truncated at the picture below):
The "Outline" view shows the current function.
It may be necessary to enable the 'Link to Editor' option in the Outline View dropdown menu. This might be off by default for CDT.
I was looking for something similar (Xcode-like bar at the top showing the current function, where you can also go to another function by clicking on it to open a popup list of functions). Here is what I settled on with Eclipse 3.5.1 CDT:
I moved the Outline view to the top, resized it to make it a 1-line horizontal strip (don't make it too narrow), and selected "Link With Editor" in its menu, so that it always shows the current function. However, this doesn't open a popup list like Xcode. For that functionality, I assigned a shortcut to the "Show Outline" command which does open a popup list of all functions.
The Eclipse function 'show outline' will pop up a list of outline objects, and it will highlight the object your cursor is inside in grey. It's typically bound to 'ctrl-o' (the letter 'o', not zero), but you can re-bind it as you see fit. I'm running Eclipse with the CDT plugin and it works pretty well for me.
To enable the breadcrumb invoke Toggle Java Editor Breadcrumb in the toolbar or press Alt+Shift+B in the Java editor.
You can also display the Quick Outline (ctrl+o). This way you see the context quickly without having to have a permanent Outline Window linked to the Editor.
Use the "Link With Editor" option on the outline menu
Press Ctrl+o (cursor is currently inside a function at a particular line).
It highlights the current method, or name of the class if the cursor is outside the method body.
You can click on highlighted method.
It has got inline search feature ...start typing name of the method to navigate to the specified method or method with matching search pattern.
If you press again Ctrl+o to shows the inherited members/methods.
Using outline with "link with editor" option worked also for me, thanks!
Just an addition, you can move outline pane in to the same window group as search, progress etc. saves the space in your perspective instead of keeping it at another group.