Where is debugger in xcode 4




















We revisit breakpoints later in this series. The pause button pauses or suspends the application's process. This isn't something you do very often. It's more useful to pause the application by setting a breakpoint at a specific location or when a certain condition is met. Notice that the pause button turns into a play button when the application is paused. This allows us to resume the application's process.

You can ignore the three buttons on the right of the pause button. We revisit those when we discuss breakpoints in more detail.

The next button is more interesting. If we click this button, the application is paused and Xcode shows us an exploded version of the application's user interface. This is the view debugger that ships with Xcode. It shows us the views of the application as well as the view controllers responsible for managing the views. View debugging is very useful for debugging issues related to the user interface. We explore this aspect of debugging in a later episode in more detail. When you're debugging a view hierarchy, the application is paused and a snapshot of its current state is used for debugging.

We can exit the view debugger by clicking the resume button in the debug bar. A few years ago, Apple added another type of debugging to Xcode, debugging the memory graph of the application's process.

This can be very useful to detect memory issues, such as retain cycles or memory leaks. If you click this button, the application is paused and the debugger captures the memory graph of the process. We don't see anything interesting in this example. In a later episode, I show you how to leverage this tool to detect retain cycles and other memory issues.

Developers usually spend their time writing code indoors behind a desk, which makes debugging issues related to location services challenging. It becomes a little bit easier thanks to Xcode's ability to simulate location changes. This button allows you to simulate the location for the current debug session. You can also provide a GPX file to simulate several location changes. That can be useful to simulate, for example, a user going for a walk or a run.

The simulator also has support for simulating location changes. We take a closer look at breakpoints in a later episode of this series, but I'd like to give you a quick peek at the Breakpoint Navigator. You can add a breakpoint by clicking the gutter on the left in any source file. The breakpoint shows up as a blue arrow.

If we run the application again, Xcode suspends the application the moment it hits the breakpoint. Notice that the variables view is now populated with information. We zoom in on this aspect later in this series. The console allows us to interact with LLDB.

The po command stands for print object and it prints the object to the console. A project or workspace can have dozens of breakpoints. You can find an overview in Xcode's Breakpoint Navigator on the left. This makes it easy to enable and disable breakpoints, or to jump to the location of a specific breakpoint.

For more information on breakpoints, including how to set breakpoint actions and the different kinds of breakpoints, see Xcode Help. When your app is paused, the currently executing line of code is highlighted in green. You can step through execution of your code using the Step Over , Step Into , and Step Out buttons located in the bar at the top of the debug area.

Step over will execute the current line of code, including any methods. If the current line of code calls a method, step into starts execution at the current line, and then stops when it reaches the first line of the called method.

Step out executes the rest of the current method or function. When execution pauses, the debug navigator opens to display a stack trace.

Select an item in the debug navigator to view information about the item in the editor area and in the debug area. As you debug, expand or collapse threads to show or hide stack frames. Hover over any variable in the source code editor to see a data tip displaying the value for the variable. Click the Inspector icon next to the variable to print the Objective-C description of the object to the debug area console and to display that description in an additional popover.

You can implement a custom Quick Look display for your own objects. Memory corruption crashes can be hard to reproduce and even harder to find.

Address sanitizer adds instrumentation to your app that enables Xcode to stop your app where the corruption happens. Address sanitizer finds problems such as accessing deallocated pointers, buffer overflow and underflow of the heap and stack, and other memory issues.

Faisal Memon Faisal Memon 1, 12 12 silver badges 23 23 bronze badges. I enable the developer mode and has the same issue. What I tried is to debug another simple application and I succeeded, only with one application does that happen to me. From a terminal you could run lldb and then provide the command process attach -n "vaion" --waitfor --verbose replacing vaion with the name of your app. Then whilst in the simulator launch the app.

Compare the outputs between the app that works and the app that fails and share the output with us. Maybe Erase and Reset Settings within the Simulator also in case of a bad build.

That looks like a good attach. Also it says "user1" whereas people normally have "johndoe" or something as their user account.

Is it a shared or temporary machine, or guest account, or lower privileged account? If lldb can attach but Xcode cannot, I recommend deleting and reinstalling Xcode. Worth reporting to Apple if that does not fix it. Add a comment. Put breakpoints to your code whatever you want to debug by clicking the number of line. Hope it helps Picode Picode 1 1 gold badge 4 4 silver badges 10 10 bronze badges. I already did that and it didn't work out for me.

The debug panel should at least remain open as an indicator that debug is activated but it is not, just the application opens the panel closes and does not stay at the breakpoints I put.

Can you share an image? After several restart Xcode returns to normal : — Picode. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown.



0コメント

  • 1000 / 1000