3

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...

AlbeegartDev
  • 101
  • 1
  • 1
  • 7

3 Answers3

12

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.

Injectios
  • 2,777
  • 1
  • 30
  • 50
7

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.

Alberto Salas
  • 220
  • 4
  • 7
2

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.

learn_develop
  • 1,735
  • 4
  • 15
  • 33