Cannot step into a particular function in a library in Xcode 4.2/iOS 5.0 - ios

I am working on an iPhone app in which I need to include a library (lib.a) for the app to work. This library (lib.a) consists of multiple files(classes). While debugging, I noticed that I could not step into any function in the file sync.m (included via lib.a), but I could step into any function in file (data.m) (also included via lib.a). I am wondering as to why I can step into one file and not another. I am using XCode4.2/iOS 5.0
I have checked all the debug settings in both my app and the library.
Generate Debug Symbols => yes (for debug)
I am also in the "run for debug mode".
The only thing that I suspect at this point is that I moved the sync.m from one folder to another ... Would that cause a problem with respect to the debug symbols ??? Where are the debug symbols stored? In the dsym file? Where can I find this file as I would like to see which debug symbols are being generated and which are not.
I would appreciate it if anyone can throw some light on this issue.

The object was not being retained and thus was pointing to nothing(NULL). Obviously, therefore function couldn't be stepped into.

Related

XCode can't find symbols for a specific iOS library/framework project

I'm having a problem with breakpoints in the source code of a specific library / framework (new to Xcode - i'm not sure what the correct term is) in a fairly large iOS project. I have all the code for this library. Breakpoints are working fine everywhere else, but in this one specific library, all breakpoints are ignored.
I can put a breakpoint in a function called from within one of those source files, and it will trigger, but then the callstack shows "__lldb_unnamed_function" for the location in the file i'm interested in, as if the symbols have been stripped.
I have the following settings for the library in question
Generate Debug Symbols = YES
Strip Debug Symbols During Copy = NO
Strip Linked Product = NO
Dead Code Stripping = NO
I have been using a lot of #ifdefs to test alternate implementations of a few functions so i thought some stuff might be getting marked as dead code by accident (hence that last setting). I already tried clean/rebuild. I tried completely removing the app from the target iPhone. I tried deleting intermediate file folder under
/Library/Developer/Xcode/DerivedData
The code is definitely executing because all my NSLog calls show up properly.
I don't have much experience with Xcode so i'm hoping i'm just missing something simple
Thanks
Some part of your build process must be stripping this binary. If you were generating an unstripped binary with no debug information, then you would see full symbol names in backtraces and the like, you just wouldn't have debug information for them.
The only good way to figure out who is doing this is to look at the full build log in Xcode, and expand each of the stages and grub through all the build stages to figure out who is doing this. You expand the stages by hovering over each build line on the RHS and you'll get a disclosure dingus that looks like a bunch of lines on a page; click that to see the real commands.
Another way to finesse this may be to build the dSYM for this framework (by setting the Debug Format to "DWARF + dSYM".) That should get made before anything gets stripped, so unless whoever is stripping this is being awfully clever this should preserve the debug information.

How movable are iOS debug symbols in Xcode?

I'm using QuincyKit to analyse crash dumps from my iOS apps. QuincyKit's symbolication script is capable of handling both my code and system code - as long as the debug symbols for the relevant version of iOS are present on the machine.
Said symbols reside under (Home)/Library/Developer/Xcode/iOS DeviceSupport. Question - did anyone ever try to move those folders from one machine with Xcode to another?
I could use some 7.0.x symbols; chances of getting a device with that version are practically nil by now.
Just check the source of symbolicatecrash.pl that you use for symbolication.
It searches the iOS system symbols in the following paths:
/System/Library/Developer/Xcode/iOS DeviceSupport/
~/Library/Developer/Xcode/iOS DeviceSupport/
Xcode.app/Contents/Developer/Platforms/*.platform/DeviceSupport/
These paths are hardcoded and may change with every update of the script (as it is part of Xcode).

NSLog not printing messages to console after packaging the static library to a framework

I have a static library which I use this iOS Framework Script to generate a .framework file and distribute to developers.
But, currently there is an issue appeared that it only happens when packaging and using the .framework in a client application! When using the static library by the way it works perfect, NSLog and the problem I have it's not reproducing.
What I want to ask is, why I lost my NSLog messages? Does this have to do with debug/release scheme configuration? The framework script does not seem to remove with any configuration in the command line the debug logging, I don't remember anyway if in release it removes the NSLogs?!
Any thoughts how to make my debug NSLog messages appear again, maybe a setting that I switched values and now banging my head to find and resolve the issue?
I found the proper way to use log messages with level as instructed by Apple using the ASL (Apple Logging System).
https://developer.apple.com/library/mac/documentation/MacOSX/Conceptual/BPSystemStartup/Chapters/LoggingErrorsAndWarnings.html#//apple_ref/doc/uid/10000172i-SW8-SW1
That said using this great wrapper by Mike Weller did the job and I can control better the logging to console plus I finally have console output from my static framework.

Static Library works fine with debug,but does not with release

I have an iOS project which has a static library and in the library there is a encrypt method and in the method it refers a lot of system encrypt method about AES encryption. When I build the static library with release,it returned the correct data.But when I build with debug mode,it returns nil.
What's the differences between the two modes?
The same source code can build out different binary files that works differently?
Help me,thanks beforehand. This is where I choose the two modes.
The main difference is the level of compiler optimization. Select the project target and look at the Build Settings and compare Debug to Release.
One potential reason for the crash is that the code has some memory usage errors that by coincidence do not cause a crash with code optimization but do with no optimization. Or there are some other configuration difference. See the comment by #iDev.
A starting point is to fix all warnings, both compiler and Analyzer. The examine the crash log to understand the crash. If you need help with that add a crash report to your question.

Error in generating Archives

I m using Xcode 4.2 and i have add AviarySDK 2.4.4 in my project.
Application runs fine in Simulator 5.0 and 4.3. I also test it on device having ios 4.1. So i want to generate .ipa file for my client. But by some reason it can not generate Archives.
It gives following error
"/usr/bin/strip -S /Applications/Projects/AppName/AppName/AviarySDK/Resources/AviarySDKResources.bundle/AviarySDKResources -o /Users/User/Library/Developer/Xcode/DerivedData/WDYWT-avjpbcnwjylobvgevipvsqttnopd/ArchiveIntermediates/WDYWT/InstallationBuildProductsLocation/Applications/WDYWT.app/AviarySDKResources.bundle/AviarySDKResources
/usr/bin/strip: for architecture armv7 object: /Applications/Projects/AppName/AppName/AviarySDK/Resources/AviarySDKResources.bundle/AviarySDKResources malformed object (unknown load command 10)
error: strip /Applications/Projects/AppName/AppName/AviarySDK/Resources/AviarySDKResources.bundle/AviarySDKResources: /usr/bin/strip exited with 1
"
Any help will really great. Many thanks in advance.
Strip errors are generally caused if you have duplicate debugging symbols in your project. Just try the following:
First Method:
Go to build settings of your project
Type Strip in the search Bar.
Under Strip Debug Symbols During Copy, you shall find Debug and under that you shall find Any SDK.
Select NO in Any SDK, select YES in Debug and select YES in Strip Debug Symbols during copy.
A little below you shall find Use Separate Strip. Select YES.
Check that Strip Style should remain All Symbols [If not then change it to that].
Second Method:
Since your error also mentions derived data, their might me duplicacy of your derived data as well. Delete Your project file from the derived data folder.
If you don't know where the derived data folder is, Google it.
I am using aviary in my current project. I have a Mac Mini and a MacAir [for work at home].
I was facing the same strip issues with aviary which I resolved using the first method mentioned above.
It took me a week to figure this out cuz i am a relative newbie in development and nothing regarding this issue has been mentioned in aviary forums as well.
PS:
MacMini: Xcode 4.5
MacAir: Xcode 4.2
Hope this helps

Resources