xcode – 如何通过OS X上的系统库进行调试?
发布时间:2020-12-14 19:06:02 所属栏目:百科 来源:网络整理
导读:我正在调试一个调用系统库的 Cocoa应用程序.我为自己的代码获取调试符号,但不是系统库,这使我无法进一步调试.如何获取系统库的调试符号. 我正在使用gdb,在10.6.4(gcc 4.2)上针对10.5 SDK进行编译. 这是我希望获得符号的堆栈跟踪: (gdb) bt#0 0x93713e43 in
我正在调试一个调用系统库的
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 还有其他问题(在正确的系统上没有正确的版本)很难克服,所以我没有测试过. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |