How to add breakpoint at runtime when debugging Golang using VSCode? - debugging

After activating a debug session, the program started running. At this time, I tried to create a breakpoint. Unfortunately, it said "Unverified Breakpoint" and the color turned into dark black, different from the other pre-defined one (which was red). You can see more clearly on the image below. The debugger would never stop at the line of the breakpoint.
Did I miss any steps?

Related

Vscode debugger hits a breakpoint on page reload

I'm debugging a react application using VS Code debugger for Edge (The newer Chromium edition, I used to use Chrome, AFAIR there was the same problem). When I reload a page, the "paused in debugger" label appears a couple of times, then disappears. It doesn't bother me too much, but the problem is it always opens Sources panel and because of that on every reload I have to open Console manually which is very annoying.
I'm absolutely sure I have no breakpoints on, the Breakpoints panel in Edge is empty, the Breakpoints panel in VS Code only contains my breakpoints and the problem persists if I disable all of them. I also have Uncaught exceptions breakpoint turned on, but disabling it doesn't help. Sources panel opens some React internal file, namely injectGlobalHook.js. Also sometimes after reloading a page I open VS Code to find that it opened a tab with react-dom.development.js for some reason. Is it supposed to work like this? And is it possible to make Console tab open on reload, because it's impossible to work like this

Xcode 10.2 restore breakpoint line highlighting when stepping through?

I've had the macOS Mojave turned to dark mode and back a couple time. I'm seeing a weird bug where most of the time my breakpoint debugging no longer highlights the line currently being executed. I get a green bubble saying "Breakpoint" to the right, but the line itself is not highlighted.
How do I restore Xcode 10.2 not highlighting the lines stepped through while debugging with breakpoints?
Toggling between different stack trace levels at the "thread" restores highlighting when switching between levels, but within the same level, I lose highlighting as soon as I select anything else, and I don't get the highlighting restored when I click on the breakpoint within the same level.
I would expect to see a faint gray highlight to appear on the same line as the debug bubble (same as cursor at the bottom of the image).
I would expect to see every time I click on breakpoint

Program window not viewable during debug pause

When my program is paused in Visual Studios 2010 during debugging, like from reaching a break point and me doing a manual step through, the program window becomes impossible to view.
It is a GUI window not a console window, which I run simultaneously with my program and am still able to view. The window seems to be open it's just that when I click its icon on the taskbar it doesn't come to the front of all the other windows. When I minimize all the windows in front of it, I see the outline of the window but it is either blacked out or showing the remnants of previously expanded windows.
I've noticed this with using Visual Studio's before (various versions of it), and after trying other IDE's that didn't have this behavior I notice it more. It would be really helpful to view the program's change's as I step through the program. Anyone know how I can do this?
I searched a long while and couldn't find a single reference to this matter.
The reason the window doesn't display is that the window paint message won't be processed if the main thread has been paused. Which other IDEs let you do this? I haven't come across any native code debuggers that do this on Windows.
If you are stepping through code that is run by the main thread, then the main thread can't simultaniously poll the message pump, which is needed for the GUI to work.
If you debug a different thread, the GUI will work while you are debugging.

Xcode: Breakpoints disabling themselves

I set a breakpoint but when I run my program it looks like it disables itself. Any ideas what's going on? The breakpoint arrow is dark blue before I run the program, and upon execution changes to light blue.
Breakpoints in Xcode can be fickle...most of the gotchas are detailed in this SO thread:
Why Aren't My Breakpoints Working in Xcode

How can I stop losing all my IDE window position when pressing the start debugging button?

I use Visual Studio 2008. I haven't seen this behavior before and, as far as I know, I didn't change anything in the options.
When I press Start debugging all the possibly windows (watch 1 - 4), data sources, properties, registers (to be honest I have not even ever seen these windows before) appear in front of the code window and stay there after I stop the debugger.
Anyone has an idea what could be causing this ? (I am using CodeRush and Refactor for quite a while now)
When I close and restart visual studio all the windows are where they should be.
PS: Previously I have seen normal switching from normal to debug mode and back with some repositioning changes. That is the way it used to work. Now it is not. It has suddenly gone mad and when going to the debug mode it sometimes shows all possible IDE windows and sometimes not. When it does it no longer returns to the previous state. I cannot find this in the options anywhere.
Visual Studio remembers 2 sets of window layouts, normal mode and debugging mode. My solution is to arrange my normal windows exactly like I want them, then start debugging an application and once again arrange all of the windows the way I want, usually making it as similar to my normal layout as possible, then stopping the debugger and doing a File Exit so that VS saves my settings.
After doing that, it recalls my 2 different layouts each time.
I'm experiencing the same thing - whenever the debugger is running, switching focus back to the IDE immediately caused the debug panel to expand.
I ended up just pinning the debug panel so that it always appears when debugging, and just changing its height as needed.
To add to palehorse, another tip is Full Screen mode.

Resources