Mac QuickTime component debugging

纵饮孤独 提交于 2019-12-07 20:18:15

问题


Firstly, I am a newbie on Mac programming. I have downloaded macam project and successfully compiled debug version to 32-bit code with Xcode 4.1. The output is a QuickTime component that I manually copy to Library/QuickTime folder. Now I want to debug the component but have no luck. I enable multiple breakpoints in the code and then use Product->Debug->Attach to Process to check the webcam output in Skype. Skype shows the (dummy) webcam running but my breakpoints do not work. I am sure my functions are called as they are the ones drawing color stripes as webcam output.

Apple documents on debugging a shared library are not very good. Is there something fundamental wrong with my approach or something simple I need to do first? Any guidance is much appreciated.


回答1:


One of the easiest ways of debugging this, if you are going to use a third-party application like Skype, is going to be thru debug statements or a network socket.

What you can do, is create a UDP socket to send messages, as well as a client application to listen for them. This will provide you access to realtime information from your application...

You can also put in UDP listen statements to wait for (your other testing app) to send parameters.

I know this isn't the traditional way of debugging, and it can cause its own problems, but if done properly, can provide tons of useful debugging when all other tools fall short.




回答2:


The approach I used for debugging of my QuickTime component project was to use NSLog() in the beginning and return of every major function in the format ClassName functionName: parameters... I then used Console (Search for console in spotlight) app to view the logs. This might not be the easiest/best way but I did succeed to debug and complete my component.

Edit: this question provide some more useful information about NSLog How to print out the method name and line number and conditionally disable NSLog?



来源:https://stackoverflow.com/questions/7104314/mac-quicktime-component-debugging

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!