Xcode - stepping over the debugger to cursor location - xcode

Is there a way to to step over the debugger to the cursor location?
In many occasions I want to skip a whole section of code while debugging, in that case I have to put a new breakpoint in the line I want to go to and click the continue execution button. I can't believe Xcode lacks the step over to cursor function.

Right-click on the line and select "Continue to Here".

If you move the cursor over the line number a little icon comes out that is a little play button That lets you run the code and stop at that selected line. Give that a try.

Related

Visual Studio Debugging: How do I go to specific line without dragging the debug arrow?

I have a class with many lines in it. I can hit a breakpoint and then drag the yellow break arrow back to a specific line but it can be difficult to do this when the line of code you need is hundreds of lines away.
Is there a way to accomplish this by typing in the line number you'd like to take the arrow to?
Also, how do you jump to a line in a different class file?
Thanks in advance.
Right-click the desired line and select "Set next statement". Or you can use the default keyboard shortcut Ctrl+Shift+F10.
This feature can only be used to set the statement to another line in the same method/function, so you won't be able to skip to a different file.
You don't have to drag the yellow line just go to the line right click and select set next statement

How to use "marker" in R-studio

I found that by using mouse click, we can create a red dot as a "marker" in R-studio. This is very nice. But how to simply go to this line with a marker?
I use SAS also. In SAS, it is like pressing Ctrl+F2 to create a marker, and press F2 to go to the next marker.
Anyone use this before? Thanks!
That isn't a marker but rather a breakpoint. When you run a script with a breakpoint, execution will stop there. Unfortunately there isn't currently a way to jump to breakpoints.
You can get similar behavior by inserting sections: use Code -> Insert Section to add a section, then Code -> Jump To to jump to any section quickly (there are hotkeys for these as well).

Going back to previous line while debugging on visual studio

I am debugging a piece of code on visual studio and I forgot to note down the values I have kept a watch on. Can I go to previous line without rerunning the entire code?
There are similar questions asked on SO but in my case i haven't run through any error or exception. The code is running normally.
After pausing on a break point, right click on the line you want to "go back" to. From the menu that pops up, select "set next statement".
This will adjust the instruction pointer to continue from the specified line of code, but it will not roll back any variables or memory addresses to the values they were at before that line of code was originally executed.
It sounds like what you want to do is rewind / replay your code rather than just move to a specific line. You can move to a specific line, you can just right click and choose set next statement. Unfortunately, this won't rewind the state of the program to some past point (beyond setting the stack and doing a bit of unwinding).
To rewind/replay you need to be a bit trickier. Some options are: -
VMWare replay which will allow you to record and then go back to a certain point in time.
Intellitrace. I haven't tried it, but it allows you to replay to a point.
Which is a bit heavyweight and wont help you right now.
You can use the mouse to drag the yellow arrow pointing to the "next statement to be executed." This actually changes which statement will be executed next. It's not guaranteed to work, but as long as the code is not too complex, it could.

add watch not working in Visual Studio 2010

I right-click in the Watch 1 window and select Add Watch but nothing happens.
It is very unintuitive. The command doesn't do anything beyond adding a new row and selecting it. You next type the name of the variable. More intuitive is right-clicking an identifier name in the editor window + Add Watch. Or drag + drop it into the Watch window.
Right click (in your code) on the variable or expression (select it) you want to watch. It will be added to the Watch window.
Little question, large answer! You give us few details of what is happening...
Summarizing, be sure that current statement is around the place where your desired watched variables are, so you can see them on debug mode, i.e.:
Place a break point near there (press F9). Remember that it must be where the variable exists (remember that on C/C++/C# a common variable created inside brackets ({ and }) will be inaccessible outside it - something like that occurs on other languages);
Run the program (F5) and do something that let you on the right place (like pressing a button that launches the function where there are variables you want to watch);
To choose a variable to watch, on debug you must press mouse right button on it and "add watch". "Walk towards" using debug functions step into (F11), step out (shift+F11), step over (F10) or run-until-next-break-point (F5).

Visual Studio 2008 - Debugging tips/tricks - Continue "until next function" or "until next file"

Is there any way to tell the debugger to just continue until the next file is accessed, and/or until the next (developer written) function is accessed, without setting debug points ahead of time? I'm kind of new to VS debugging so all I use right now are f5, f10, and f11.
There is currently no way to do what you are asking. The main ways of telling VS to go until something happens are the following
Hit F5 and VS will go until the next user breakpoint or ,depending on your settings and where it occurs, the next exception is raised
Right click and select "Run to cursor"
Shift-F11 breaks out of the current method
Run to cursor doesn't require an explicit break point but it does require that you know where you want to break next.
You can right-click and select "run to cursor" if you just want to run to a specific line ahead in the execution stream.
Another one is Shift-F11 which finishes the current method and breaks again when you get back to the caller.
Actually, there is a way to set conditional break points.
Click in the left margin on the line where you want to break, as usual. (or F9)
Right-click on the red dot. In the context menu, click on "Condition...."
In the dialog, set your condition, e.g., fileName == "foo"
Hit F5 and go until the conditional break is hit.
Looks like there's not a way to do what I wanted to do

Resources