I am building a static library and am receiving no compiling errors, however, when I link it against a demo project(basic single view app). I cannot step into the methods called from the static library to debug it...
I'm not receiving any runtime errors, but I think that is because it's not being executed due to the fact my NSLogs are not being shown, and it's not returning anything...
Basically, how do I debug a static library I created through the demo app I also created..
What do I do? I need help!!
Thanks in advance...
To use runtime debugger
you should add your static
library project as subproject
to your sample where you want to debug it.
Make sure that GENERATE_DEBUG_SYMBOLS
is set to YES (debug mode) for your static
lib.
In case of using in project compiled static
library (libYourLib.a) you won't be able step into methods but still should see NSLog
coming.
If your static library is not a subproject or it is not in the same workspace, first make sure that GENERATE_DEBUG_SYMBOLS
is set to YES (debug mode), as @Injectios says. Then go to Breakpoint Navigator, add a new "Symbolic Breakpoint" with the class/method you are interested in, and run your application.
The way I generally do it in my pre-compiled static library is that I would add a breakpoint at viewDidload
and then when the breakpoint is hit and if we know which methods to add the breakpoint to, I would add a breakpoint like b <function_name>
and then press continue, and when that function is hit during the execution, it would break and we can use regular lldb options to continue, step over and step into the code.
来源:https://stackoverflow.com/questions/25512585/debugging-a-static-library-in-xcode