I am working with a number of 3rd party suppliers, who have provided me with comprehensive .lib files. One of the processed that are running are logging a message to the console that is a little concerning and needs to be raised with the supplier.
The problem is, I'm not sure where the message is coming from and, due to the complexity of the project, would be pretty much impossible to see where the message is coming from. By this, I mean, that some libraries interact with each other and the project will not run without others. If I were to comment out the initialisation of certain classes, it could be a red-herring as it may be calling a function from another library.
My question is, is there a feature in Xcode breakpoints (or another tool that I may be able to use) that shows where a certain console log (whether it be NSLog or possibly std::cout etc) is coming from?
Thanks a lot, in advance.
Luke
Yes, use symbolic breakpoints to break on NSLog or std::cout. If you are dealing with C++ code or Swift you can even break on specific errors or exceptions. To add symbolic breakpoints to your project, you have to do the following:
std::cout; in objective C: -[NSObject(NSObject) doesNotRecognizeSelector:]; in C or Swift, CGErrorBreakpoint() - Important Note - avoid inserting any white space; unfortunately, the formatting in here puts -[symbol] in different lines but there must be no white space between - and [ in the ObjC symbolbt for getting a backtrace every time you hit such a symbolIf your library is throwing a C++ exception, you can break on this too. Just choose that option when you click on the + button. To know more how to set breakpoints in Xcode go to:
http://help.apple.com/xcode/
And navigate to: Debug your app > Set Breakpoints > Pause execution when events occur
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With