Go back to current debug line in Netbeans - netbeans

While debugging Java in Netbeans you set up a break point and inspect variables and execute step by step, etc.
However, once the program is paused you often check other parts of the code.
Is there any shortcut or menu item to return back the screen to the source code and line where the program is halted?
Not sure if relevant but I am using both Netbeans 8.2 and 11.

When debugging you have a Debug window with the tabs "Variables", "Call Stack" and "Breakpoints".
To go back to the source line of the current break point, open the "Call Stack" tab. Then right click on the top most entry of the stack and choose "Goto source".
If you don't have the "Call Stack" tab, you can open it using the menu item "Window -> Debugging -> Call Stack"

Related

In Eclipse IDE how to disable the closing of an editor tab via plain right-click

I am using Eclipse Oxygen (Ver 4.7.0) on CentOS with the UI shown via MobaXterm's X Windows server on Windows 7.
In Eclipse I have the weird problem that when I right-click on an editor tab the tab closes immediately! No context menu, nothing, just the tab vanishes. I would like to disable this, but I couldn't find any entry for right-clicking in the Keys section of the Preferences.
Is there another place where the right-click behaviour is set? Or how else can I disable this? The problem occurs only for editor tabs.
Additional details:
The right-click behaves correctly inside an editor tab by bringing up the context menu. This shows that the right-click is not genearlly broken in the X Window system.
The right-click behaves correctly in other X applications like PyCharm.
An explanation
A closer look revealed that Eclipse does show the context menu on right-click press-down, but on right-click release-up it registers a left-click event.
Due to the particular situation of when the context menu was drawn, the mouse pointer than just always happens to sit over the top entry in the menu. And this top entry is Close. The following screenshot might illustrate this a bit (unfortunately without the mouse pointer):
Solution
The immediate solution for me is to move the mouse after pressing the right mouse button and before releasing it.
Still I don't know why this happens only when right-clicking a tab and only for me - and probably not for many other people...

Netbean 8 Variables Window, Watches Window, Breakpoints Window, Call Stack Window, Output Window don't auto hide after debug

Netbean 8: Variables Window, Watches Window, Breakpoints Window, Call Stack Window, Output Window don't auto hide after debug. How i can fix this problem. Thanks.
Click Window and choose Reset Windows from the menu.
After doing this, the debug windows should auto-hide. I recommend taking a screenshot before doing the reset in case other customizations you made are inadvertently lost.
Click on Minimize Window Group which is on top right corner of variable window or other windows. If you have maximized it then after debug you need to click on Minimize Window Group after debug.
I figured this out for the Output window.. if you open that view, you'll see an icon on the left-hand side which says "Ant Settings" when hovered over. Click that, and it will open the 'Options --> Java' dialog.
In that dialog, select the 'Always Show Output' option. Now anytime you build your project (etc) that Output view will pop up, and when you click back in the Editor it will auto-hide.

How to remove "Debug Current Instruction Pointer"

I tried to use the debugger in Eclipse, but when I hit my
breakpoints, the Eclipse "Debug Current Instruction Pointer" is often
pointing at the wrong source line.I really want to remove "Debug Current Instruction Pointer". "Project -> Clean..." doesn't seem to help, nor does
restarting Eclipse, nor does rebooting.
The "Debug Current Instruction Pointer" is the position where you paused debugging last time. You can simply resolve it by following the below two steps
Go to the "Debug" preference/panel
Then click on the red square button to terminate the debugging you were executing last time or press Ctrl+F2 (Windows)
Now, just debug the program again. The execution will be starting from the "Toggle Breakpoint".
Note: You can delete the Toggle Breakpoint by double click on the line number and redefine the new according to your requirements by right click on targeted line number and select "Toggle BreakPoint" or press Ctrl+Shift+B (Windows)
Go to the debug view (as your current debug session is running) and complete or terminate current debugging session. this way you will get rid of "Debug Current Instruction Pointer"
What helped me was remove all breakpoints - right-click, RemoveAll.
sometimes breakpoints remain in eclipse list even after we remove them by clicking over them, to remove
Show Breakpoints view by navigating menu
Window>>Show View>>Other>> Select Debug>>Breakpoints
In Breakpoints view, uncheck unnecessary breakpoints
To prevent this pointer from ever being displayed in the first place, go to
Preferences -> General -> Editors -> Text Editors -> Annotations ->
select Debug Current Instruction Pointer -> uncheck "Vertical ruler"
box
"Debug Current Insturction Pointer" isn't something you would want to remove since it is not something that is set in any way, ist just a pointer to the current instruction where the debugger has paused your application. You can see that easily if you just step through your application and see how the "Debug Current Insturction Pointer" is moving along.
If you think it is pointing at the wrong source-line there are two reasons I can think of right now:
There are some "old" breakpoints left from earlier debug-sessions. You should see the breakpoint-marker and be able to remove it. If you want to get rid of all existing breakpoints just go to the breakpoints-view and remove them all using the double-X-icon.
The source-file shown in the debug-window doesn't match the class file that is currently running. This is most likely to happen in some imported libraries and not in your own project's code, but if it still does happen a clean/rebuild should take care of the problem.
You need to get out of the current debug session. Go to the debug console and end the current session by hitting the red square button.
This should remove all the debug current instruction pointers.
Check the arguments written in Run Configuration, because they can be wrong.
To reach Run Configuration, right click the project's main class -> Run As -> Run Configurations -> Java Application on menu -> Arguments. In the text Area write your arguments and try to debug again.

Is there a keyboard shortcut for stopping the current console in Eclipse?

I'm developping a Java application with a class containing main. I can start the application using Ctrl+Alt+X J subsequently the application can be re-run by hitting Alt+R T Enter to choose the menu option for the first item in the Run history.
But to stop the application, I have to click on the small red square in the console view. This is annoying, because it forces me to use the mouse, type Alt+R T Enter then re-focus the editor using the mouse again.
Eclipse being so configurable, there must be a keyboard shortcut to stop the application run in the current console I haven't found. There are an entry in Window > Preferences > Keys called Terminate and Terminate and Relaunch but no matter what binding I assign or what when conditions I set and no matter if I use the Debug perspective or not, they don't seem to fire.
Please help an Eclipse newbie avoiding the mouse :)
Go to Preferences -> General -> Keys
Find "Terminate" Set your binding to whatever you want.
Then change "When" from "Debugging" to "Editing Java Source".

Write JavaScript in Chrome developer tools

In Firebug, I can type my own JavaScript in the console tab and execute it. Is there a way to type JavaScript in Chrome Developer Tools and execute it?
Go to chrome://flags/, enable the "Enable Developer Tools experiments" flag and restart Chrome (or start it with the --enable-devtools-experiments command-line flag.)
Open DevTools, go to the Settings dialog, switch to the Experiments tab.
Enable the "Snippets support" experiment, close and reopen DevTools.
Go to the Sources panel. In the left-hand navigator sidebar, switch to the Snippets tab .
Right-click in the [empty] tree in this tab, select the New context menu item.
Give the new snippet any name you like and type the snippet body.
Once done, click the Run (>) button in the status bar to execute the snippet body. You can set breakpoints in snippets and debug them as ordinary scripts.
Step 1: Open Google chrome Dev tool [ Press f12 ]
Step 2: Click on Sources tab
Step 3: On left side panel, Click on Snippets tab (may be hidden, if so click >> and it will appear)
Step 4: To create new snippet click + New snippet or right-click within the Navigator, and then select New
Step 5: Develop your code into middle pane and save it.
Step 6: To run Snippet, there are three ways
A: Ctrl + Enter
B: Click on Run button [ Into Right-side panel, Top-Left button ]
C: Right-click on the snippet filename (in the pane on the left that lists
all your snippets) and select Run.
Recent Chrome
Using Chrome 50, juste open the "Console" tab and start typing and executing your code at the bottom of the console.
Arrow up, recalls the code, ctrl-enter gives you a new line:
You can't debug Javascript, but you can execute it (including jquery) in a REPL in the chrome inspector.
Open the inspector
Click the button at the bottom left with 3 lines - its tooltip is "show console"
Type your javascript and press enter
Note you usually have to go to the Sources tab and click the "pause script execution" button for your javascript to get evaluated.