How to add a breakpoint to objc_exception_throw?

后端 未结 4 1398
予麋鹿
予麋鹿 2020-11-22 08:55

this was the answer from the brad larson on this SO question

If you add two breakpoints, you should be able to debug these exceptions. To do this, go to Run | Show |

相关标签:
4条回答
  • 2020-11-22 09:15

    I think Brad's answer is pretty clear; hopefully this can help if you're not finding it clear.

    In Xcode, from the top menu click on Run > Show > Breakpoints. A new window pops up.

    Select "global breakpoints" in the left hand menu. There should be a box on the right under the "Breakpoint" column with the text "Double-Click for symbol". Single-click in this box and type in "objc_exception_throw".

    Then, single-click in the space next to "objc_exception_throw" under the "location" column. A box will appear for you to type in the location (in this case, "libobjc.A.dylib"). I've made a screenshot that will hopefully help:

    alt text

    0 讨论(0)
  • 2020-11-22 09:15

    I would also like to recommend adding the +[NSException raise:format:arguments:] breakpoint and its location should be CoreFoundation.

    0 讨论(0)
  • 2020-11-22 09:20

    In Xcode 4 this great breakpoint can be added via "+" button on Breakpoints section (⌘ + 6)

    enter image description here

    0 讨论(0)
  • 2020-11-22 09:27

    in Xcode 6 -- from top menu

    Debug > Breakpoints > Create Exception Breakpoint

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