Page MenuHomePhabricator

[intel-pt] Refactor 3: refactor PTDecoder into SBPTProcess

Authored by wallace on Aug 3 2020, 1:48 PM.



Depends on D85070.
I don't think PTDecoder is structured very well, and the name is also misleading,
as it doesn't just "decode". Given that the Python API generation has been
broken for a long time and that one of my recent patches fixes it, I assume
there's no problem in changing the API, as there has been no users.

A first fundamental change I want to do is to stop having PTDecoder as a top
level class that receives an SBProcess for any action it needs to do. The
existing way requires a good amount of boilerplate code here and there with
little to no benefit.
Instead, I'm renaming it into SBPTProcess. I think the SB is consistent with the
LLDB SB API, and this class now directly manages one SBProcess. This means that
whenever you want to trace or decode an SBProcess, you create a SBPTProcess
class, which is easier to reason about in an OOP way.

I've updated the test accordingly, and I've noticed that the code is now much
simpler, with less faiture points and checks.

Diff Detail

Event Timeline

wallace created this revision.Aug 3 2020, 1:48 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 3 2020, 1:48 PM
wallace requested review of this revision.Aug 3 2020, 1:48 PM
wallace edited the summary of this revision. (Show Details)Aug 3 2020, 1:53 PM
wallace abandoned this revision.Aug 3 2020, 3:00 PM

After syncing up with Greg, we decided to redo this in a different way