Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I break on all symbolicated code in Xcode 4.6?

I'm untangling spaghetti code and as an exercise I'm walking through the application from its launch, breaking on applicationDidFinishLaunching and stepping over and into.

When this first method returns I then break into assembly. Knowing when to step over and when to step into is a real pain. I want the debugger to pause on all the symbolicated code (i.e. code I can see in Xcode – maybe this is called 'user' code? Basically, non framework/library code.), but I don't care about Apple's internal methods.

I'm looking for the practical equivalent of setting a breakpoint on the first line (or every line) of every method and function that I (or my predecessor) has written.

Is there some LLDB voodoo that will do this?

like image 705
Swizzlr Avatar asked Feb 25 '13 18:02

Swizzlr


1 Answers

There's a simple way of setting breakpoints on all of your modules' functions, excluding those of any other shared library (Apple frameworks), assuming your product/module is called 'MyApp' that would be:

breakpoint set -s MyApp -r .

However, this will include any library you have statically linked to, which probably means any library you've brought in since dynamic linking isn't allowed in the App Store.

If you tend to prefix your classes, you could narrow down the results by only breaking on functions that are part of classes with that prefix. Assuming your prefix is 'MA' you can do something like:

breakpoint set -s MyApp -r ^[^A-Za-z]*MA

which should cover the majority of your code.

like image 154
yonilevy Avatar answered Sep 19 '22 05:09

yonilevy