Is it possible to create a data breakpoint in Xcode?

后端 未结 2 751
误落风尘
误落风尘 2020-12-31 02:51

The data breakpoints in Visual Studio is very a very useful debugging tool and I need something like that for my current iPad project (pointers and memory acting strange). <

相关标签:
2条回答
  • 2020-12-31 03:30

    I'm not familiar with Visual Studio but I guess you're looking for watchpoints. Search for "watchpoint" in the Xcode Debugging Guide.

    0 讨论(0)
  • 2020-12-31 03:48

    Here is the documentation for the Watchpoint in Xcode :

    To monitor changes to the value of variables or data items, you can set watchpoints. A watchpoint pauses execution of the program whenever the value of the watched item changes. You can set a watchpoint on a variable only when execution of the program is halted. To set a watchpoint on a variable:

    With execution of the program paused at a breakpoint, select the variable in the Variable list in the Debugger window. See “Debugging in the Debugger” to learn more about the Variable list. Choose one of the following: Run > Variables View > Watch Variable Watch Variable from the variable list shortcut menu Xcode displays a magnifying glass next to the variable to indicate that the variable is being watched, as shown in Figure 7-5. Figure 7-5 Watched variable in the Variable list

    When the value of the variable changes, Xcode pauses execution of the program and displays a dialog showing the location of the program counter and the new value of the variable. If execution of the program moves beyond the scope of the current variable, Xcode deletes the watchpoint and pauses execution of the program.

    Important: Watching local variables, located on the stack, can cause your program to crash if system calls are made in the current function.

    0 讨论(0)
提交回复
热议问题