Getting info about bad memory address in LLDB

前端 未结 4 1750
南笙
南笙 2021-01-30 04:37

I am trying to debug an EXC_BAD_ACCESS in my iPhone app. It is crashing on a method call and on the line of the method is EXC_BAD_ACCESS (code=1, address = xxx).

4条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-30 05:09

    This problem is very easy to solve with an informative backtrace. Unfortunately with the latest version of iOS and Xcode, a good stack track is sometimes hard to come by. Fortunately you can set an 'Exception Breakpoint' in Xcode to allow you to examine this code prior to the EXC_BAD_ACCESS exception.

    1. Open the breakpoint navigation in Xcode 4 (This looks like a rectangle with a point on the right side)
    2. Press the '+' button at the bottom left and add an 'Exception Breakpoint'. Ensure you break 'On Throw' for 'All' exceptions.

    Now you should get a full backtrace immediately prior to this exception occurring. This should allow you to at least zero in on where this exception is being thrown.

提交回复
热议问题