我如何在〜/ .gdbinit中设置这些断点? [英] How do I set these break points in ~/.gdbinit?
问题描述
Here is a list of break points to put in ~/.gdbinit that are really helpful in debugging memory problems:
fb - [NSException raise]
fb - [NSAssertionHandler handleFailureInFunction:file:lineNumber:description:]
fb - [NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:]
#define NSZombies
#这会给你提供帮助信息。设置为NO将其关闭。
set env MallocHelp = YES
#也可以在启动参数中设置。
set env NSZombieEnabled = YES
set env NSDeallocateZombies = NO
set env MallocCheckHeapEach = 100000
set env MallocCheckHeapStart = 100000
set env MallocScribble = YES
set env MallocGuardEdges = YES
set env MallocCheckHeapAbort = 1
set env CFZombie 5
fb - [_ NSZombie init]
fb - [_ NSZombie retainCount]
fb - [_ NSZombie retain]
fb - [_ NSZombie release]
fb - [_ NSZombie autorelease]
fb - [_ NSZombie methodSignatureForSelector:]
fb - [_ NSZombie respondsToSelector: ]
fb - [_ NSZombie forwardInvocation:]
fb - [_ NSZombie class]
fb - [_ NSZombie dealloc]
fb szone_error
fb -[NSException raise]
fb -[NSAssertionHandler handleFailureInFunction:file:lineNumber:description:]
fb -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:]
#define NSZombies
# this will give you help messages. Set to NO to turn them off.
set env MallocHelp=YES
# might also be set in launch arguments.
set env NSZombieEnabled=YES
set env NSDeallocateZombies=NO
set env MallocCheckHeapEach=100000
set env MallocCheckHeapStart=100000
set env MallocScribble=YES
set env MallocGuardEdges=YES
set env MallocCheckHeapAbort=1
set env CFZombie 5
fb -[_NSZombie init]
fb -[_NSZombie retainCount]
fb -[_NSZombie retain]
fb -[_NSZombie release]
fb -[_NSZombie autorelease]
fb -[_NSZombie methodSignatureForSelector:]
fb -[_NSZombie respondsToSelector:]
fb -[_NSZombie forwardInvocation:]
fb -[_NSZombie class]
fb -[_NSZombie dealloc]
fb szone_error
推荐答案
这个标题表明你在问怎么在〜/ .gdbinit中设置这些,但是你的详细问题的第一行表明你有〜/ .gdbinit中的上述内容?
The title of this indicates that you are asking how to set these in ~/.gdbinit but the first line of your detailed question indicates that you have the above in ~/.gdbinit?
到底是什么问题,然后呢?
What, exactly, is the problem, then?
我使用了和它相似的东西工作正常,但由于其中大部分都是相当侵入性的行为变化,我把它放在一个单独的文件(〜/ .gdbmem)中,然后根据需要进行发布。
I use something pretty similar and it works fine, but since much of this is fairly intrusive behavioral changes, I put it in a separate file (~/.gdbmem) and then source it as needed.
我的〜/ .gdbinit几乎完全限于不改变调试会话的宏定义。因此,默认行为对调试的影响最小,我可以从2个额外的文件中选择一个充满gdb config goop的文件,以自动将一些相对侵入性的附加配置应用于环境。
My ~/.gdbinit is limited almost entirely to macro definitions that don't otherwise change the debugging session. Thus, the default behavior is minimal impact on debugging and I can source one of 2 additional files full of gdb config goop to automatically apply some relatively intrusive additional configuration to the environment.
这篇关于我如何在〜/ .gdbinit中设置这些断点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!