这是我的堆栈跟踪异常。如何在私有方法中在调试器控制台中自行打印
#0 0x049f088a in objc_exception_throw()
#1 0x05f933b5 in __NSFastEnumerationMutationHandler()
#2 0x03046e9d in -[UIView(Hierarchy) _makeSubtreePerformSelector:withObject:withObject:copySublayers:]()
#3 0x03047043 in __85-[UIView(Hierarchy) _makeSubtreePerformSelector:withObject:withObject:copySublayers:]_block_invoke()
#4 0x03046f14 in -[UIView(Hierarchy) _makeSubtreePerformSelector:withObject:withObject:copySublayers:]()
#5 0x03047043 in __85-[UIView(Hierarchy) _makeSubtreePerformSelector:withObject:withObject:copySublayers:]_block_invoke()
#6 0x03046f14 in -[UIView(Hierarchy) _makeSubtreePerformSelector:withObject:withObject:copySublayers:]()
#7 0x03046d3e in -[UIView(Hierarchy) _makeSubtreePerformSelector:withObject:]()
#8 0x03052187 in -[UIView(Internal) _addSubview:positioned:relativeTo:]()
#9 0x03045846 in -[UIView(Hierarchy) insertSubview:atIndex:]()
#10 0x02fde714 in __53-[_UINavigationParallaxTransition animateTransition:]_block_invoke()
#11 0x0304c3ef in +[UIView(Animation) performWithoutAnimation:]()
#12 0x02fddc96 in -[_UINavigationParallaxTransition animateTransition:]()
#13 0x03118e4e in -[UINavigationController _startCustomTransition:]()
#14 0x031250c7 in -[UINavigationController _startDeferredTransitionIfNeeded:]()
#15 0x03125cb9 in -[UINavigationController __viewWillLayoutSubviews]()
#16 0x0325f181 in -[UILayoutContainerView layoutSubviews]()
#17 0x03055267 in -[UIView(CALayerDelegate) layoutSublayersOfLayer:]()
#18 0x04a0281f in -[NSObject performSelector:withObject:]()
#19 0x023b12ea in -[CALayer layoutSublayers]()
#20 0x023a50d4 in CA::Layer::layout_if_needed(CA::Transaction*)()
#21 0x023a4f40 in CA::Layer::layout_and_display_if_needed(CA::Transaction*)()
#22 0x0230cae6 in CA::Context::commit_transaction(CA::Transaction*)()
#23 0x0230de71 in CA::Transaction::commit()()
#24 0x0230e544 in CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*)()
#25 0x05ecb4ce in __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__()
#26 0x05ecb41f in __CFRunLoopDoObservers()
#27 0x05ea9344 in __CFRunLoopRun()
#28 0x05ea8ac3 in CFRunLoopRunSpecific()
#29 0x05ea88db in CFRunLoopRunInMode()
#30 0x058939e2 in GSEventRunModal()
#31 0x05893809 in GSEventRun()
#32 0x02fead3b in UIApplicationMain()
#33 0x000035f8 in main at /Users/dmueller39/Projects/ios-bloomberg/Bloomberg/main.mm:18
当我捕获到这个时,我让调试器暂停。如何在第2帧上打印自身的值?
这个答案正是我想要的。如果我可能如此大胆,我可以问问你读过哪些技术博客? – Saltymule
在lldb中,通过为参数寄存器伪寄存器名称'p/x $ arg1'等(在armv7上,x86_64上,args在regs中传递的arm64上)将会显示它们。但是对于在你的回溯中间的栈帧,你将不得不反汇编该函数并且查看该参数被保存的位置(如果它被保存在任何地方)......只要另一个函数被调用,则该arg传递寄存器被重用于不同的值。 lldb甚至不会在堆栈的中间向你展示它们,因为它知道它们已经被破坏了。你真的需要在func的开始。 –