Mac QuickTime 组件调试
首先,我是Mac编程的新手。我已经下载了 macam 项目 并使用 Xcode 4.1 成功将调试版本编译为 32 位代码。输出是一个 QuickTime 组件,我将其手动复制到 Library/QuickTime 文件夹中。现在我想调试该组件但没有运气。我在代码中启用多个断点,然后使用“产品”->“调试”->“附加到进程”来检查 Skype 中的网络摄像头输出。 Skype 显示(虚拟)网络摄像头正在运行,但我的断点不起作用。我确信我的函数被调用,因为它们是绘制彩色条纹作为网络摄像头输出的函数。
苹果关于调试共享库的文档不是很好。我的方法是否存在根本性错误,或者我需要先做一些简单的事情?非常感谢任何指导。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我用于调试 QuickTime 组件项目的方法是在每个主要函数的开头和返回中使用 NSLog(),格式为 ClassName functionName:parameters... 然后我使用 Console(在聚光灯下搜索控制台)应用程序来查看日志。
这可能不是最简单/最好的方法,但我确实成功地调试并完成了我的组件。
编辑:这个问题提供了一些有关 NSLog 如何打印方法名称和行号并有条件禁用的更有用的信息NSLog?
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?
如果您要使用 Skype 等第三方应用程序,最简单的调试方法之一就是通过调试语句或网络套接字。
您可以做的是创建一个 UDP 套接字来发送消息,以及创建一个客户端应用程序来侦听消息。这将使您能够访问应用程序中的实时信息...
您还可以放入 UDP 监听语句以等待(您的其他测试应用程序)发送参数。
我知道这不是传统的调试方式,它可能会导致自己的问题,但如果做得正确,可以在所有其他工具都达不到要求时提供大量有用的调试。
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.