Page MenuHomePhabricator

Improve ReadRegister for RegisterContextWindowsx86
ClosedPublic

Authored by amccarth on Feb 11 2016, 10:00 AM.

Details

Reviewers
zturner
Summary

In some circumstances (notably, certain minidumps), the thread CONTEXT does not have values for the control registers (EIP, ESP, EBP, EFLAGS). There are flags in the CONTEXT which indicate which portions are valid, but those flags weren't checked. The old code would not detect this and give a garbage value for the register. The new code will log the problem and return an error.

I consolidated the error checking and logging into a helper function, which makes the big switch statement easier to read and verify.

Ran tests to ensure this doesn't break anything. Manually verified that a minidump without info on the control registers now indicates the problem instead of giving bad information.

Diff Detail

Event Timeline

amccarth updated this revision to Diff 47674.Feb 11 2016, 10:00 AM
amccarth retitled this revision from to Improve ReadRegister for RegisterContextWindowsx86.
amccarth updated this object.
amccarth added a reviewer: zturner.
amccarth added a subscriber: lldb-commits.
zturner accepted this revision.Feb 11 2016, 10:21 AM
zturner edited edge metadata.
This revision is now accepted and ready to land.Feb 11 2016, 10:21 AM
Eugene.Zelenko added a subscriber: Eugene.Zelenko.

Committed in r260559.