我正在使用Xcode 4.5中的X86_64程序。我在_NSWarnForDrawingImageWithNoCurrentContext上得到警告,並停止在沒有上下文的情況下進行繪圖調用。該調用發生在深層的CALayer/NSView調用中。我想知道這與什麼觀點有關。檢查lldb幀堆棧上系統調用的參數
#0 0x00007fff9033f823 in _NSWarnForDrawingImageWithNoCurrentContext()
#1 0x00007fff8ffd2cf3 in -[NSImageRep drawInRect:fromRect:operation:fraction:respectFlipped:hints:]()
#2 0x00007fff901444ea in -[NSImageRep _newCGImageForProposedRect:context:hints:flipped:]()
#3 0x00007fff8ffd3acb in -[NSImageRep CGImageForProposedRect:context:hints:]()
#4 0x00007fff9006be1d in -[NSImageRep CGImageForProposedRect:context:hints:flipped:]()
#5 0x00007fff900f0346 in -[NSImage _newSnapshotRepForRep:rect:context:processedHints:]()
#6 0x00007fff900923c8 in -[NSImage _snapshotRepForRep:rect:context:processedHints:]()
#7 0x00007fff9006bd77 in __48-[NSImage CGImageForProposedRect:context:hints:]_block_invoke_0()
#8 0x00007fff8ffd14d6 in -[NSImage _usingBestRepresentationForRect:context:hints:body:]()
#9 0x00007fff9006b9e5 in -[NSImage CGImageForProposedRect:context:hints:]()
#10 0x00007fff8ff14754 in -[_NSImageLayerContents CA_copyRenderValue]()
#11 0x00007fff890350c3 in -[CALayer(CALayerPrivate) _copyRenderLayer:layerFlags:commitFlags:]()
#12 0x00007fff89034a7c in CA::Context::commit_layer(CA::Layer*, unsigned int, unsigned int, void*)()
#13 0x00007fff890349a4 in CA::Layer::commit_if_needed(CA::Transaction*, void (*)(CA::Layer*, unsigned int, unsigned int, void*), void*)()
#14 0x00007fff8903492f in CA::Layer::commit_if_needed(CA::Transaction*, void (*)(CA::Layer*, unsigned int, unsigned int, void*), void*)()
#15 0x00007fff8903492f in CA::Layer::commit_if_needed(CA::Transaction*, void (*)(CA::Layer*, unsigned int, unsigned int, void*), void*)()
#16 0x00007fff8903492f in CA::Layer::commit_if_needed(CA::Transaction*, void (*)(CA::Layer*, unsigned int, unsigned int, void*), void*)()
#17 0x00007fff8903492f in CA::Layer::commit_if_needed(CA::Transaction*, void (*)(CA::Layer*, unsigned int, unsigned int, void*), void*)()
#18 0x00007fff8903492f in CA::Layer::commit_if_needed(CA::Transaction*, void (*)(CA::Layer*, unsigned int, unsigned int, void*), void*)()
#19 0x00007fff8903492f in CA::Layer::commit_if_needed(CA::Transaction*, void (*)(CA::Layer*, unsigned int, unsigned int, void*), void*)()
#20 0x00007fff8903492f in CA::Layer::commit_if_needed(CA::Transaction*, void (*)(CA::Layer*, unsigned int, unsigned int, void*), void*)()
#21 0x00007fff8903492f in CA::Layer::commit_if_needed(CA::Transaction*, void (*)(CA::Layer*, unsigned int, unsigned int, void*), void*)()
#22 0x00007fff8903492f in CA::Layer::commit_if_needed(CA::Transaction*, void (*)(CA::Layer*, unsigned int, unsigned int, void*), void*)()
#23 0x00007fff8903492f in CA::Layer::commit_if_needed(CA::Transaction*, void (*)(CA::Layer*, unsigned int, unsigned int, void*), void*)()
#24 0x00007fff8903492f in CA::Layer::commit_if_needed(CA::Transaction*, void (*)(CA::Layer*, unsigned int, unsigned int, void*), void*)()
#25 0x00007fff8903492f in CA::Layer::commit_if_needed(CA::Transaction*, void (*)(CA::Layer*, unsigned int, unsigned int, void*), void*)()
#26 0x00007fff890258d6 in CA::Context::commit_transaction(CA::Transaction*)()
#27 0x00007fff89025423 in CA::Transaction::commit()()
#28 0x00007fff9010f032 in -[NSView(NSLayerKitGlue) _drawRectAsLayerTree:]()
#29 0x00007fff8ffbe35a in -[NSView _drawRect:clip:]()
#30 0x00007fff8ffbb093 in -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]()
#31 0x00007fff8ffbbb24 in -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]()
#32 0x00007fff8ffba223 in -[NSThemeFrame _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]()
#33 0x00007fff8ffb5e4d in -[NSView _displayRectIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:]()
#34 0x00007fff8ff7fd73 in -[NSView displayIfNeeded]()
#35 0x00007fff8ff7f2ac in _handleWindowNeedsDisplayOrLayoutOrUpdateConstraints()
#36 0x00007fff9054a971 in __83-[NSWindow _postWindowNeedsDisplayOrLayoutOrUpdateConstraintsUnlessPostingDisabled]_block_invoke_01208()
如何找出視圖_drawRect:剪輯:正在呼籲?
我試圖切換到第29幀,然後做一個p/x $arg1
但提供了錯誤
error: Couldn't materialize struct: Couldn't read rdi (materialize)
我只找到源代碼,並提交與此相關的錯誤日誌和無法弄清楚什麼它的意思是。任何幫助將不勝感激,因爲這也有助於避免使用過時的調用給出警告的Apple代碼消息。