Search for Xcode Debug Message Source

I work with several third-party providers who provided me with complete .lib files. One of the processed ones that start logs a message on the console, which touches a little and needs to be picked up with the provider.
The problem is that I'm not sure where the message is coming from, and because of the complexity of the project, it would be 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 work without others. If I commented on the initialization of certain classes, it could be red-herring, since it might call a function from another library.
My question is, is there a function at Xcode breakpoints (or another tool I can use) that shows where a particular console log comes from (be it NSLog or maybe std :: cout, etc.)?

Thank you very much in advance. Luke

+2
source share
1 answer

Yes, use symbolic breakpoints to break NSLog or std::cout . If you are dealing with C ++ or Swift code, you can even break certain errors or exceptions. To add symbolic breakpoints to your project, you must do the following:

  • Go to the breakpoint navigator by clicking the icon that looks like a thick right arrow in the navigation area (in Xcode 8, counting the second icon to the right of the panel to the left of the editor)
  • Click the + button in the lower left corner of the window
  • Select Symbolic Breakpoint in the pop-up menu.
  • Add the character you want to split (examples: in C ++, std::cout ; in the C object: -[NSObject(NSObject) doesNotRecognizeSelector:] ; in C or Swift, CGErrorBreakpoint() - Important note - avoid pasting any free space unfortunately, the formatting here puts - [character] in different lines, but there should not be spaces between ObjC characters between - and [
  • If you know what a library is that gives you sadness, fill out the module field
  • Click the action button and select Debugger Command from the popup menu
  • In the text box below, enter bt to get a backtrace every time you click this character
  • If you do not want to stop execution after reaching the first breakpoint, select the Automatically continue after evaluating actions check box.

If your library throws a C ++ exception, you can do it. Just select this option when you press the + button. To learn more about how to set breakpoints in Xcode, follow these steps:

http://help.apple.com/xcode/

And go to: Start and debug > Set breakpoints > Pause execution when events occur

+2
source

All Articles