Page MenuHomePhabricator

[MIPS] Emulate instruction using MCDisassembler
ClosedPublic

Authored by jaydeep on Apr 27 2015, 10:01 PM.

Details

Summary

EmulateInstructionMIPS64 has been modified to use llvm::MCDisassembler instead of duplicating the decoding logic. Added emulation of few branch instructions for software single stepping.

Diff Detail

Repository
rL LLVM

Event Timeline

jaydeep updated this revision to Diff 24528.Apr 27 2015, 10:01 PM
jaydeep retitled this revision from to [MIPS] Emulate instruction using MCDisassembler.
jaydeep updated this object.
jaydeep edited the test plan for this revision. (Show Details)
jaydeep added reviewers: clayborg, jasonmolenda.
jaydeep set the repository for this revision to rL LLVM.
jaydeep added subscribers: bhushan, slthakur, mohit.bhakkad, Unknown Object (MLST).
clayborg requested changes to this revision.Apr 28 2015, 9:52 AM
clayborg edited edge metadata.

Just move stuff from the header to the .cpp file and this is good to go.

source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h
13–25 ↗(On Diff #24528)

These includes should go into the .cpp file only.

83–107 ↗(On Diff #24528)

Move to .cpp

140–166 ↗(On Diff #24528)

use "const llvm::MCInst &" so we don't have to know what an llvm::MCInst is in the header file and forward declare llvm::MCInst at top.

175–180 ↗(On Diff #24528)

Forward declare all llvm:: types so we don't have to include the headers.

This revision now requires changes to proceed.Apr 28 2015, 9:52 AM
jaydeep updated this revision to Diff 24598.Apr 28 2015, 9:46 PM
jaydeep edited edge metadata.

Addressed review comments

clayborg accepted this revision.Apr 29 2015, 9:37 AM
clayborg edited edge metadata.

Minor nit pick: we might want to make the arguments that currently take a "llvm::MCInst &" take "const llvm::MCInst &". Not sure if any function calls use non const functions, so this shouldn't hold up the patch.

source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h
124–140 ↗(On Diff #24598)

Can we make these all "const llvm::MCInst &" arguments?

This revision is now accepted and ready to land.Apr 29 2015, 9:37 AM
This revision was automatically updated to reflect the committed changes.