How to get VS Code to scroll to source line when breakpoint hit - go

When VS Code encounters a breakpoint that pauses the program, I expect the source file to be opened and the exact line of execution scrolled into view. This used to work, but it has mysteriously stopped. I have searched for a setting using words like "breakpoint", "debug", and "scroll" but have had no luck.
This seems to be happening only for my golang project, as the expected breakpoint behavior happens in a python project. I am running VS Code Go Extension v0.37.1, VS Code version 1.75.1.

Related

Why does VS 2022 always stop on the first code line while debugging

I recently updated my VS Enterprise 2022 installation to version 17.4.2. Since than, when debugging into a method (pressing F11), the debugger does not step into the method, but instead stops at the first line of the code file containing the method.
I tried to use a launchsettings.json file like this:
{
"profiles": {
"MyProject": {
"stopOnEntry": false
}
}
}
but this does not work e.g. for unit tests.
Also, the solution includes more than 180 projects, which makes it a little bit boring to modify each of them.
So my question: Is there a settings switch to generally disables this behavior? I did not find anything in the options...
I've seen this bug too, not only while debugging, but also when clicking on a result in the find-in-files window or sometimes in the call stack. I suspect the problem happens because it tries to move to a specific line before the file is actually open. The bug does (typically) not happen if the file one wants to step into is already open. A workaround is to double click again on the top of the call stack. That will move the cursor to the correct position.
I'm not sure, but I think I have not seen the bug in the latest preview version (17.5.0 Preview 2).

The payload is invalid

I am new to Laravel. When I am in debug mode I get the following errors every time every page loads:
The payload is invalid
After pressing two times on Continue I get the error
The MAC is invalid
The error messages are located inside the encrypter.php file. After pressing "Continue" again, I can proceed with debugging with breakpoints and so on, and everything works fine. The $payload-variable is null.
The project is still very basic. Only some things like CRUD like explained on tutorials.
What is payload? And am I missing some kind of configuration? How to get rid of these error messages?
The answer is found in this post:
Can't using Visual Code to debug in Laravel project
I also:
closed VS Code Editor
cleared all history in my browser, including cookies and cache
ran the commands as mentioned in the post inside the windows cmd window (so not the integrated terminal inside VS Code Editor)

ZeroBrane IDE - "run to cursor" (Ctrl+Shift+F10) mode *sometimes* not working during debug

I use ZeroBrane studio (ZBstudio) for debugging Lua code when working with the Torch framework.
A weird issue occurs at times. When debugging, sometimes I want to run the code all the way until it encounters a breakpoint. This specific mode does not work at times (sometimes it does, sometimes it doesn't; I can't figure out why).
When it doesn't work, nothing happens when I press the relevant button in the GUI (or Ctrl+Shift+F10). I can go line-by-line (Shift+F10) when this happens, the line-by-line mode is not affected.
Sometimes when this happend, restarting the ZeroBrane IDE program fixed it, other times it remains persistant.
Not sure if anyone else encountered this strange behaviour. Thanks in any case.

How do I debug a process in XCode?

Here's my situation. I have an app installed on my system. It's running. I also have the source for this app and I've built it in XCode and had it generate dSYM files. I attached to the process in XCode. I've been trying to set breakpoints of the form "-[ClassName methodName]" (without the quotes) however none of my breakpoints are getting hit. Do I have to somehow point XCode to my symbol file or something?
I have never debugged using that method, but there is a much easier way. You can simply click on the line number of a code-bearing line and a blue arrow (a breakpoint) will appear there. When the application reaches one of these lines with a breakpoint, execution will pause an allow you to step through the code one line at a time.

pausing execution javascript in code not in google chrome debugger

I am writing a Google Chrome extension. One of my content scripts has a little bug that I can't find and the Google Chrome debugger appears to be useless for this purpose. The code stops on an Uncaught typeError: Cannot set property 'value' of null. I can see this by opening the debugger and viewing the console after the code fails. But my content script does not appear in the list of scripts shown in the debugger at this point. There are a lot of scripts shown there, including a big block of scripts in light blue. But none named "profile.js" which is my content script.
I tried "location.reload(); but it simply returns "undefined." I'd love to step thru this code and find the problem but I can't figure out how to do it. I've set alerts to try to track the problem but once I click on the alert, the script continues with no opportunity to invoke the debugger. Based on the result of the alert experiment, it appears the code is failing at the very end. I presume the code is finished by the time the error is caught and the script is no longer available to the debugger.
I tried adding this line to the script: "debugger;" to try and force the debugger to open but there is no change whatever to the execution of the code. It fails as usual and as usual I can open the debugger, find the console message and the big list of scripts that does not include mine.
How can I pause execution of the code using a line in the code itself? I just want to stop execution of the code at the beginning, invoke the debugger, set up some breakpoints, resume execution and monitor some variables. That seems like a pretty simple and do-able request.
Any ideas?

Resources