This is an archive of the discontinued LLVM Phabricator instance.

Use an unwinder to get register contexts of frames other than zeroth under Windows
AbandonedPublic

Authored by aleksandr.urakov on Jul 5 2018, 4:00 AM.

Details

Summary

The current version of TargetThreadWindows::CreateRegisterContextForFrame function always returns the register context of the zeroth frame. This patch uses an unwinder to get register contexts of frames other than zeroth.

Diff Detail

Event Timeline

This can be tested after applying D49018 patch.

Excuse me, I have forgot to add lldb-commits as a subscriber, so I'll repeat initial message.

The current version of TargetThreadWindows::CreateRegisterContextForFrame function always returns the register context of the zeroth frame. This patch uses an unwinder to get register contexts of frames other than zeroth.

I'm actually in the middle of cleaning up the change attached to this bug: https://bugs.llvm.org/show_bug.cgi?id=37495 which is equivalent functionally but follows the pattern for the other targets. Let me run some tests and I'll submit it for review. It should fix your issue.

amccarth added inline comments.Jul 9 2018, 4:18 PM
source/Plugins/Process/Windows/Common/TargetThreadWindows.cpp
52

This bit seems redundant given that CreateRegisterContextForFrameIndex now checks the special case of 0. It's not a big deal, but I could see someone getting confused while debugging things wondering by CreateRegisterContextForFrameIndex is sometimes called for frame 0 and sometimes not.

aleksandr.urakov abandoned this revision.Jul 10 2018, 12:14 AM

Thank you!

Yes, D49111 is more like other targets, so I think it will be a better choice. So I will abandon the current revision.