XCode 调试器很烂;备择方案?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2024063/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
XCode debugger sucks; alternatives?
提问by Potatoswatter
I've been programming on the Mac since I was a little kid using THINK C. I've never had to use a debugger as bad as the one that comes with XCode.
我从很小的时候就开始在 Mac 上使用 THINK C 进行编程。我从来没有使用过像 XCode 附带的调试器那么糟糕的调试器。
- It's unresponsive, and bogs down further and becomes unstable when watching more variables.
- When it crashes, I lose undo history for my sources because it's integrated with the editor.
- It doesn't benefit from integration, though, as the source viewer is unusable for stepping: Trying to select a line by clicking on the left margin makes a button appear from nowhere which causes to program to continueto that line, in the editor window, which shouldn't relate to debugging in the first place. Horrible UI and horrible implementation.
- A hobbled pretty-data "summary" syntax which can't send an object to the Expressions window.
- he Expressions window isn't aware of any kind of context, ever.
- Can't select a particular thread to debug, far as I can tell, and doesn't jump to the thread that called abort().
- 它没有响应,并且在观察更多变量时会进一步陷入困境并变得不稳定。
- 当它崩溃时,我会丢失我的源的撤消历史记录,因为它与编辑器集成在一起。
- 但是,它不会从集成中受益,因为源代码查看器无法用于步进:尝试通过单击左边距来选择一行会使编辑器窗口中无处出现一个按钮,这会导致程序继续到该行,这不应该首先与调试有关。可怕的用户界面和可怕的实现。
- 无法将对象发送到“表达式”窗口的笨拙的漂亮数据“摘要”语法。
- 表达式窗口永远不知道任何类型的上下文。
- 据我所知,无法选择特定线程进行调试,并且不会跳转到调用 abort() 的线程。
The kerneldebugger for Mac OS 9was better than this. It's time to give up.
Mac OS 9的内核调试器比这更好。是时候放弃了。
What standalone front-ends for GDB work on OS X? I found http://ddd.darwinports.com/but it's hard to find praise or anecdotes for it, or other alternatives.
哪些 GDB 独立前端可在 OS X 上运行?我找到了http://ddd.darwinports.com/,但很难为它找到赞美或轶事,或其他替代方法。
Support for STL containers is a big plus for me. I couldn't care less about Objective-C or Apple-anything.
对 STL 容器的支持对我来说是一个很大的优势。我根本不在乎 Objective-C 或 Apple 的任何东西。
回答by anon
I tend to use valgrind for memory related errors; gdb (in a teminal) when I want a backtrace; and logging + couts for all else (if it's not crashing, and there's no memory corruption, the bug seems easier).
我倾向于使用 valgrind 来处理与内存相关的错误;gdb(在终端中)当我想要回溯时;并记录+ couts 用于所有其他(如果它没有崩溃,并且没有内存损坏,则错误似乎更容易)。
Admittedtely, no idea how to debug multi threaded code.
诚然,不知道如何调试多线程代码。
回答by IanNorton
Have you tried monodevelop? It can build and debug C code, Not show how it handles obj-c.
你试过monodevelop吗?它可以构建和调试 C 代码,不显示它如何处理 obj-c。
If you can get DDD working I have used that with good results on many strange platforms. DDD requires X11.
如果你可以让 DDD 工作,我已经在许多奇怪的平台上使用了它并取得了很好的效果。DDD 需要 X11。
回答by cjcela
I've had the same experience with XCode, and ended up switching to Netbeans and Eclipse (still not sure which one I prefer over the other, both have strong and weak points).
我在 XCode 上也有过同样的经历,最终切换到 Netbeans 和 Eclipse(仍然不确定我更喜欢哪一个,两者都有优点和缺点)。
This may seem an odd choice, but both of them offer nice C++ support, reasonable debugger integration, and good project management options. I enjoy the refactoring tools and the source version control integration as well. Mind that they are not as snappy and clean as Visual Studio 6.
这似乎是一个奇怪的选择,但它们都提供了很好的 C++ 支持、合理的调试器集成和良好的项目管理选项。我也喜欢重构工具和源代码版本控制集成。请注意,它们不像 Visual Studio 6 那样活泼和干净。
As many others here, I do not like Objective-C, and am pretty much fed-up with having to learn different environment/frameworks for each platform I write for (I use Linux and OSX daily, Windows on occasion). Both Netbeans and Eclipse are a big plus for portability. They also support other languages that I use sometimes for smaller projects (Python comes to mind).
和这里的许多其他人一样,我不喜欢 Objective-C,并且非常厌倦必须为我编写的每个平台学习不同的环境/框架(我每天使用 Linux 和 OSX,有时使用 Windows)。Netbeans 和 Eclipse 都是可移植性的一大优势。它们还支持我有时用于较小项目的其他语言(我想到了 Python)。
回答by baol
I add to what anon said that I found also this trick on SO recently that allows easier STL debugging:
我补充说,我最近在 SO 上也发现了这个技巧,可以更轻松地进行 STL 调试:
$ cd ~
$ svn co svn://gcc.gnu.org/svn/gcc/trunk/libstdc++-v3/python
$ cat ~/.gdbinit
python
import sys
sys.path.insert(0, '/home/USERNAME/python/')
from libstdcxx.v6.printers import register_libstdcxx_printers
register_libstdcxx_printers (None)
end