How to diagnose Xcode errors - xcode

I have been using Xcode recently a lot, however, every so often I'll inexplicably receive error messages about perfectly innocuous components of my code. I'd like to know how one diagnose these because as you can see in the buttom right of the screenshot, there's no log entry to go off of. Thanks.
Here's my screen shot:

It looks as if you have accidentally set a "breakpoint" in your code. You set a breakpoint by clicking on the left margin. A breakpoint stops your code automatically when it reaches that point.
Since you commented out the inside of the goBack() function, it stops at the first line of uncommented code.
The breakpoint you set is the little blue line to the left of the line self.scoreLabel.removeFromSuperview(). To get rid of it, click it and drag it into the main area of your code.

Related

Why is my debugger "breaking" on a line where I have not set a breakpoint?

I apologize in advance, this will be a very basic & general beginner's question:
Why is my debugger "breaking" on a line where I have not set a breakpoint?
Some more detail:
I'm working on a large buggy C++ project in XCode 12.4.
I've set a single breakpoint on function A. The debugger refuses to break on function A. Instead, it breaks consistently on function B. Function A and B exist on the same cpp file. I believe function B is supposed to be called AFTER function A, but they definitely do not call each other and are not called simultaneously.
I've definitely experienced the debugger stopping on various errors, but with a RED highlight, not a GREEN one - as I understand it the GREEN highlight only happens on a breakpoint I set myself.
Is this expected behavior? Am I missing something obvious?
(First post, please tell me if I'm doing anything wrong!)
EDIT: I solved & answered my own question below!
The most common cause of the debugger pausing at a place where you didn't set a breakpoint is the throwing of an exception. Some exceptions crash the program, which is where you get the red highlight in the debugger. Some exceptions don't crash the program. In those cases the debugger highlights the exception breakpoint in green.
If the debugger pauses your program with a green highlight, click the Continue Execution button (it's the second button from the left in the group of debugging buttons right below the source code editor) or choose Debug > Continue in Xcode to continue running the program.
These are all great responses and I learned a lot from them all - but it turns out the answer was much dumber.
For whatever reason, when I compiled, XCode did not delete the previously compiled binary. As for my breakpoint issue, I'm still not 100% sure what was happening, but it is solved now.
Here's how I noticed: Function A did not exist when I compiled it last time. I had created a String in function A. This string assignment returned a bad access error - so I assume it was assigned outside the program I was debugging!
Thank you to responders!

Godot Engine Input Map

so i have been following this tutorial to get me started on a game creation engine on Godot. link here ==> https://www.youtube.com/watch?v=Mc13Z2gboEk and i've got to a point around the time 37:09 and then he told me to click "project settings", then "input map", go on to the action bar and type in "move_left" to create a function for me to move left and click "add". so I did exactly what he told me to except from one problem: nothing happened. it just cleared the action bar, i scrolled down, and there was nothing. i tried again and again, but nothing happened still. I tried putting in "ui_left" (which was already there) for a test and it said that it "already existed" so that confirmed my theory that it did not add to the input map. has anybody experienced this before and if so how do i fix it? Thanks.
it adds the new inputs to the bottom of the list. if they're not there and you're certain you're doing it exactly right (it's extremely easy to think you're doing it exactly right but just miss one thing) then you might want to uninstall/reinstall godot and see if it's just a weird bug/error from your install.

Is it possible to jump right to errors in Xcode output?

When I try to do an Xcode build and it fails, I usually get a long list of warning messages in the "Buildtime" screen on the lefthand side of my Xcode window. The actual error message (with the red exclamation mark) is usually way at the bottom, and I have to scroll for a few seconds to get to it. Also, when I do scroll to it, it then loads more warnings below, so I have to do the scrolling process several times.
Does anyone know if there's a way to either jump directly to the error message, or output all the messages to a file or something?
It's irritates, especially if you are working with react-native project where usually more than 3000 warnings and it takes ages to scroll to the bottom where errors usually shown.
How to scroll to the bottom:
Click on the any message in the "Buildtime" list
Press Option + down arrow

VS 2013 marking code in blue outline?

What's going on with this? I've never seen it before and have no idea how to turn this on or off. It doesn't do it with any other block of js code (or other code, for that matter). If I could get it to do this with every single block of code, that would be more than incredible...
If I am not wrong then most probably that's the code block where you have debug point/break point set to and so it's highlighting the same area. At least, that's what it does for C# editor; hopefully will be the same for Jquery as well.
To turn it off, remove the break point and see if it still remains.

How to return to the current debugging position in Chrome Dev Tools?

I keep finding a scenario where my code stops on a breakpoint in Chrome's debugger, then when I use another tab like "Console", and go back to "Sources", I have lost the place where the code stopped, and I have to click singles-step to get "back on track", but this skips past the sought after breakpoint. Is there some way to get to where the debugger has stopped?
You can use the call stack portion to go to the current location the debugger is stopped at by clicking the top item in the call stack.
As the original writer couldn't submit an image due to his low reputation and the ongoing rules of the site, i will glady provide one for all of us!
You can click on the breakpoint in the list of breakpoints in the breakpoint panel in Sources and it will take you back there.
You can see a line number below. (eg:Line 152, Column 1).
So give Ctrl+G+line number. eg: Ctrl+G+152. You can see the breakpoint.

Resources