[Lldb-commits] [lldb][PATCH] Clear thread unwinder when stack is reset

Kaylor, Andrew andrew.kaylor at intel.com
Mon Oct 1 13:42:04 PDT 2012

In debugging a problem with expression evaluation after an inferior function call, I tracked it back to the Thread object's m_unwinder_ap member not being cleared when the Thread state was restored from a checkpoint.  I was able to fix the problem by inserting a call to Unwind::Clear in the Thread::ResetFrameZeroRegisters function.  I thought that it might make sense to clear the unwinder every time the thread's stack was cleared (i.e. from Thread::ClearStackFrames), but I wasn't sure how that is used and whether it always indicates an actual stack change that the unwinder needs to know about.

The problem in question showed up in the BasicExprCommandsTestCase.test_many_expr_commands test on x86_64 Linux.

I'm attaching two patches, one with each implementation, though only one is needed.  Can someone offer some guidance as to which approach is preferred?


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20121001/0c8ceec5/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: unwinder-reset.patch
Type: application/octet-stream
Size: 507 bytes
Desc: unwinder-reset.patch
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20121001/0c8ceec5/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: reset-frame-zero-unwind.patch
Type: application/octet-stream
Size: 481 bytes
Desc: reset-frame-zero-unwind.patch
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20121001/0c8ceec5/attachment-0001.obj>

More information about the lldb-commits mailing list