Is it possible to easily move breakpoints in devtools? How do you stop breakpoints from moving in devtools? - google-chrome-devtools

I'm using devtools to debug my JavaScript code. Is there a way to keep the breakpoints from moving when I make changes to my code? When I make changes to the file, the breakpoint is firing on code where I don't want it to be on instead of the code I originally wanted it to fire on.
Or is there a way to do some sort of drag-and-dropping of breakpoints in devtools to at least easily move them back to where I want the breakpoint to fire? I keep having to delete the breakpoint and then add it back to the area I wanted. I tried clicking and dragging but it just deletes the breakpoint.

Related

Is there a way right click on chrome to bring up the context menu when the debugger is stopped on a breakpoint?

Sorry if this is not the right place to ask. I looked around and stackoverflow made the most sense to me. Plus it is a question that can be answered.
The specific task that I want to accomplish is I am working on an app in nw.js (it's like electron). To reload the app I right click on the page and the usual context menu comes up (the one with "inspect") and there is an option to reload the page.
When the debugger is stopped on a breakpoint that context menu doesn't show up. So in order to reload the app I have to move the mouse somewhere on the screen to close dev tools and then mouse back to the window to reload it. It makes working so much more tedious and while it only takes a moment it feels like an eternity.
Are there any flags in chrome or plugins or nw.js settings that will save me from doing this 763,000 times a day?

How do I disable the object definition window in VS Code?

In VS Code, if I Ctl+click or press F12 on an object defined elsewhere in the file, the focus is moved to that object, but additionally a window opens up showing me exactly what I'm already trying to look at except in a smaller window than I would normally be viewing the object definition. If I instead press Alt+F12, this object definition window opens without moving my focus to the object.
In the case of pressing Alt+F12, this functionality could potentially be useful since it saves me from having to navigate from the code I'm working with. However, in the case of Ctl+click or F12, both navigating away from the code I'm working with and displaying the object definition in a smaller window is not helpful and I want to disable it.
Here is an image of what I'm trying to describe when using Ctl+click or F12:
How do I disable this? I would prefer to only disable the functionality that both shows the window and navigates away, but would settle for disabling showing the window entirely.
This issue has been addressed in version 1.26.1 of VS Code.

Pause Electron with a hotkey or similar

In our Electron app I'd like to use the dev tools to inspect an element that only exists if a parent element experiences a mouseover action.
Whenever I go to interact with the dev tools my mouse has to move and the element disappears.
I know that the Chrome dev tools usually pause script execution with f8. This does not seem to work in Electron. I have also tried forcing the parent elements into :hover and :focus in the dev tools, but this does nothing.
Any ideas please on how to pause execution or force a parent into :hover?
After some more fooling around I found that if I inspect a parent element, right click on that element in the dev tools, and then click on Break on..., and click on subtree modification. I can then get the debugger going without having to insert any debugger; statements into the code.

Is it possible to save a set of breakpoints?

I have a set of breakpoints which I used for debugging one issue. When I want to debug something else, these breakpoints are annoying, so I need to disable/delete them. However, I feel that I might want to be able to recreate the first set of breakpoints later.
Is it possible to save all currently active breakpoints so that you can switch between different sets of breakpoints with just one operation?
If I have 30 breakpoints, it would be very tedious to recreate/reenable them all manually.
In Eclipse (debug perspective -> breakpoints) select all the breakpoints, right click, export breakpoints!
You can use breakpoint working sets - see eclipse help.
If you can't find the Breakpoints tab, open it on: Window > Show View > Breakpoints.
Then, as said before: Ctrl+A to select all breakpoints > right click > Export Breakpoints....

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.