tailieunhanh - Lập trình Wrox Professional Xcode 3 cho Mac OS part 60
Những ngôn ngữ máy hướng dẫn cái bẫy gây ra ứng dụng của bạn để ngay lập tức dừng lại. Nếu đưa ra từ Xcode, Xcode sẽ đính kèm các trình gỡ rối vì nó sẽ cho bất kỳ trường hợp ngoại lệ không thể khôi phục. Nếu một cái bẫy được thực hiện bên ngoài của Xcode, | In-Editor Debugging 449 A machine trap instruction is essentially a programmatic crash. It can be inserted using an assembly directive as depicted in the following listing if defined ppc__ defined ppc64 asm trap endif if defined i386__ defined x86_64__ __asm int 3 endi f These machine language trap instructions cause your application to immediately stop. If launched from Xcode Xcode will attach the debugger as it would for any unrecoverable exception. If a trap is executed outside of Xcode your program will immediately terminate. The system will treat your application as if it had crashed. Also see the Custom Executables section. Whether Xcode stops for Debugger calls or automatically attaches itself when the process crashes can be disabled for individual executables. IN-EDITOR DEBUGGING Xcode s in-editor debugging tools let you perform basic and common debugging actions right in your editing window. This means that in many situations you can edit compile run and debug your application without ever switching to another Xcode window or view. When a debugging session starts the debugger strip appears at the top of your editor pane as shown in Figure 18-6. Combined with breakpoint controls in the gutter which more than likely were already visible and additional symbol inspectors called datatips the in-editor debugging controls allow you to do three things Modify breakpoints Control execution Inspect variables FIGURE 18-6 A setting n the debugging pane of the Xcode preferences enables the n -editor se ng n e e ug g ng pane o e co e pleieiences ena es e n e o t debugging controls. If you don t see the in-editor debugging controls check your preferences. Download at 450 CHAPTER 18 DEBUGGING Editing Breakpoints Breakpoints are described in detail in the Breakpoints section of this chapter but here s the short lesson Click a line number in the gutter to create a breakpoint Click a breakpoint to enable disable it Drag a breakpoint to a new .
đang nạp các trang xem trước