In the older version of Xcode, I used to press cmd-shift-Y to get a window (I think it was the debugger) to see where errors were coming from in my iPhone app.
But now, I always see question marks, and can't ever seem to properly track where the error is coming from. How do I do it in the new Xcode?
The screenshot you have posted is thread view of debugger actually. When you get an error you can still hit Cmd+Shift+Y which is a keyboard shortcut to hide/show the debug area. It will pop up in main editor area from bottom.
In the debug area, the top horizontal bar shows the buttons to continue, Step Into, Step Over etc. In this horizontal bar, the last item on right hand side is the function name which was executed the last. You can click on that to see the stack trace and track from what function the error is coming. The function which was executed recently in the trace would be the first item in the list and the main function would be the last in this list.
Hope this helps.
Related
Recently VSCode is showing an animated line, that moves constantly from the left to the right. The movement is distracting when I am trying to code.
What is the line, and how can I disable it?
This is because it's "loading" something in the background.
Display the Ouptut console shiftcmd/ctrlu (or: View > Output) and on the right, in a selectable list, check the different tasks or logs to see what process is still pending.
Sometimes it's a plugin which is stuck, or a wrong configuration of your project.
It could also simply be a bug in VSCode.
please have a look at this screenshot:
Something is not working correctly on my site and I therefore want to debug it. Dev-tools shows that I have 5 Errors and 1 Warning, but when I CLICK on them, nothing happens. It doesn't bring me to a view, where the errors are shown.
I then search in the network panel, where the errors are shown (although I have to scroll through all requests).
The question is, shouldn't I get redirected to where the errors are shown in a list? (At least this is how it worked in the past for me.)
It might happens that console view with the errors was resized and the only caption of the console pane are visible. Another option is the filters mentioned in the comments.
If the errors and warnings were filtered out then you will see the console but it will have only marker that some messages were filtered out.
I'm using the debugger to pause execution of my program at any time and view the state of the running code, so I set breakpoints before running my executable so that I can stop at known points and view the values of variables in my source code.
After I viewed my code, it comes to one new screen. Here I press "step over" button means it come to view the next line, if I press "Continue program execution" button means then it skipped the step by step execution and comes to execution part. Image shown below.
My doubt is, why the compiler come here after viewed my code? How to analyse this assembly language coding and what is the purpose of this code?
If you pause execution or a breakpoint is triggered, the debug area opens, displaying the values of variables and registers plus the debug console. You can use the buttons at the right end of the debug area toolbar to display both the variables and console panes or to hide either one.
The variables pane displays variables and registers. You specify which items to display using the pop-up menu in the top-left corner of the variables pane:
Auto displays only the variables you’re most likely to be interested
in, given the current context.
Local displays local variables.
All displays all variables and registers.
Use the search field to filter the items displayed in the variables pane.
The console pane displays program output and lets you enter commands to the debugger tool. You specify the type of output the console displays with the pop-up menu in the top-left corner of the console pane:
All Output displays target and debugger output.
Debugger Output displays debugger output only.
Target Output displays target output only.
Use these to understand what is happening at break points.
Maybe your code casted exception and goes back to [UIViewController loadViewIfRequired] method . This method is in the compiled program and it is binary now so you won't see the source code and the assembly language is presented instead.
It is possible that [UIViewController loadViewIfRequired] has exception handling code.
I am using Eclipse 3.4 and debugging Java. I have set a couple of breakpoints and that works fine. I run to a line and then it stops. I can inspect and all.
BUT If you I choose to enter a class or more I loose where the breakpoint actually was, that is where the debugger has stopped. I have to keep track of it myself and scroll back and stuff.
I just want to go back to where the last breakpoint was ( that is where the debugger has stopped )
How can I do that?
Thanks!
=== EDIT ===
I know that I can watch the call stack but nothing there is highlighted so it is a bit difficult.
I do not know of such a possibility.
However, depending on the number of active breakpoints you are using, maybe the "Breakpoints" view can help. Here you can see all breakpoints you have defined. If you make a doubleclick on an entry, Eclipse jumps to the corresponding source location.
I am working on an iPhone project containing a ton of code. The application receives outside requests and performs actions. However, I cannot figure out exactly where the app begins executing code for a particular event. Is there some functionality in Xcode which would allow me to solve this problem?
Thank you.
Have you tried setting break points in your code? Click on the line numbers column in Xcode on the number to set a break point.
Without knowing more about what these requests are or where they are coming from, its hard to give any advice on what tools Xcode might have, but looking in any project files named <xxx>AppDelegate.m or <xxx>Controller.m would be a good start, placing breakpoints on likely sounding methods.
I figured out that you can use the Instruments Profiler to this end.
Start the profiler
Choose "Time Profiler"
In the bottom left section make sure the following are checked: Show Obj-C only and Hide System Libraries
In the timeline, click on the the point before the event occurred.
Click the left-most icon in "inspection range" (located on the top-bar immediately to the left of clock)
In the timeline, click on the point after the event completed. (optional)
Click the right-most icon in "inspection range"
Inspect the Call Tree.