gpt4 book ai didi

xcode - 如何通过 OS X 上的系统库进行调试?

转载 作者:行者123 更新时间:2023-12-04 21:51:24 25 4
gpt4 key购买 nike

我正在调试一个调用系统库的 Cocoa 应用程序。我得到了自己代码的调试符号,但没有得到系统库,这会阻止我进一步调试。如何获取系统库的调试符号。

我正在使用 gdb,针对 10.6.4 (gcc 4.2) 上的 10.5 SDK 进行编译。

这是我想获取符号的堆栈跟踪:

(gdb) bt
#0 0x93713e43 in CFQSortArray ()
#1 0x936f4c49 in CFArraySortValues ()
#2 0x958f0bc0 in ColorSyncProfileCopyTagSignatures ()
#3 0x9591d218 in CMMProfile::Usable ()
#4 0x9591cb5d in DoValidateProfile ()
#5 0x9591cc75 in AppleCMMValidateProfile ()
#6 0x958f1e52 in ColorSyncProfileVerify ()
#7 0x91b13b88 in validateProfile ()
#8 0x91b13aed in CMSValidateProfile ()
#9 0x93b27f6c in CGCMSInterfaceValidateProfile ()
#10 0x93b27f4c in CGCMSUtilsValidateProfile ()
#11 0x93b27e4b in CGColorSpaceCreateICCBased ()
#12 0x93b27203 in create_generic_color_space ()
#13 0x93b26f92 in CGColorSpaceCreateWithIndex ()
#14 0x90228ad5 in +[NSColorSpace specialColorSpaceWithID:] ()
#15 0x90228a0c in +[NSColorSpace genericRGBColorSpace] ()
#16 0x9022881e in -[NSBitmapImageRep _bitmapImageRep_setColorSpaceName:] ()
#17 0x904f6e39 in -[NSBitmapImageRep initWithBitmapDataPlanes:pixelsWide:pixelsHigh:bitsPerSample:samplesPerPixel:hasAlpha:isPlanar:colorSpaceName:bitmapFormat:bytesPerRow:bitsPerPixel:] ()
#18 0x902282ae in -[NSBitmapImageRep _initWithSharedBitmap:rect:] ()
#19 0x90227efe in -[NSImage _addRepresentationWithSharedKitWindow:rect:] ()
#20 0x90226d06 in +[NSImage _findSystemImageNamed:] ()
#21 0x90226a48 in +[NSImage imageNamed:] ()
#22 0x902268ea in -[NSCustomResource _loadImageWithName:] ()
#23 0x9022681e in -[NSCustomResource loadImageWithName:] ()
#24 0x90225d5f in -[NSCustomResource awakeAfterUsingCoder:] ()
#25 0x915a2208 in _decodeObjectBinary ()
#26 0x915a14e4 in _decodeObject ()
#27 0x9022556f in -[NSMenuItem initWithCoder:] ()
#28 0x915a21ec in _decodeObjectBinary ()
#29 0x915a2ff8 in -[NSKeyedUnarchiver _decodeArrayOfObjectsForKey:] ()
#30 0x915a3665 in -[NSArray(NSArray) initWithCoder:] ()
#31 0x915a21ec in _decodeObjectBinary ()
#32 0x915a14e4 in _decodeObject ()
#33 0x90229ff0 in -[NSMenu initWithCoder:] ()
#34 0x915a21ec in _decodeObjectBinary ()
#35 0x915a2ff8 in -[NSKeyedUnarchiver _decodeArrayOfObjectsForKey:] ()
#36 0x915a3665 in -[NSArray(NSArray) initWithCoder:] ()
#37 0x915a21ec in _decodeObjectBinary ()
#38 0x915a14e4 in _decodeObject ()
#39 0x9021ff29 in -[NSIBObjectData initWithCoder:] ()
#40 0x915a21ec in _decodeObjectBinary ()
#41 0x915a14e4 in _decodeObject ()
#42 0x9021f4a8 in loadNib ()
#43 0x9021eb5b in +[NSBundle(NSNibLoading) _loadNibFile:nameTable:withZone:ownerBundle:] ()
#44 0x9021e811 in +[NSBundle(NSNibLoading) loadNibFile:externalNameTable:withZone:] ()

最佳答案

如本苹果技术说明中所述,您要将 DYLD_IMAGE_SUFFIX 设置为 _debug。

http://developer.apple.com/library/mac/#technotes/tn2004/tn2124.html

还有其他问题(在正确的系统上没有正确的版本)很难克服,所以我没有对此进行测试。

关于xcode - 如何通过 OS X 上的系统库进行调试?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3806015/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com