使用.gdbinit将XCode gdb输出记录到文件 [英] Log XCode gdb output to file with .gdbinit

查看:193
本文介绍了使用.gdbinit将XCode gdb输出记录到文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试将来自XCode的gdb输出重定向到日志文件以进行自动测试。我已经使用AppleScript自动运行应用程序进行测试的过程,但我需要能够看到输出。我已经尝试使用.gdbinit文件和

  set logging file< filepath> 
设置日志覆盖
设置日志记录

但是我得到了警告:当前输出协议不支持重定向在我的日志文件中。除了提到TUI模式的问题之外,搜索这个错误消息的位并不多。如果这是问题,我该如何关闭XCode中的TUI模式?如果不是的话,是什么导致了这个警告? 解决方案

根据这个问题的答案:将调试输出从XCode 4控制台重定向到日志文件



您可以使用此系统默认值将Xcode的GDB输出记录到文件中:

defaults write com.apple.dt.Xcode IDEGDBLogToFile /tmp/logs.txt



它适用于Xcode 4.2。确保在设置该默认设置后重新启动Xcode。


I'm try to redirect gdb output from XCode to a log file for automated testing. I've automated the process of running an app for testing using AppleScript, but I need to be able to see the output. I've tried using the .gdbinit file with

set logging file <filepath>
set logging overwrite on
set logging on

but I get "warning: Current output protocol does not support redirection" in my log file. A bit of searching for this error message didn't turn up much, besides a mention of a problem with "TUI-mode." If this is the problem, how do I turn off TUI-mode in XCode? If not, what is causing that warning?

解决方案

As per an answer to this question: Redirecting debug output from XCode 4 console to a log file

You can use this system default to log Xcode's GDB output to a file:

defaults write com.apple.dt.Xcode IDEGDBLogToFile /tmp/logs.txt

It works for me with Xcode 4.2. Just make sure to restart Xcode after you set that default.

这篇关于使用.gdbinit将XCode gdb输出记录到文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆