Skip to content

Commit

Permalink
Clean up dyn_regs.h usage (#235)
Browse files Browse the repository at this point in the history
* Add missing usages of 'dyn_regs.h'

This corresponds to cleanups of its usage in Dyninst.

* Use arch-specific register files

* Remove aarch64 subdir
  • Loading branch information
hainest authored Oct 27, 2023
1 parent e897b87 commit eca2df1
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/instruction/aarch64_cft.C
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include "Instruction.h"
#include "InstructionDecoder.h"
#include "Register.h"
#include "registers/aarch64_regs.h"

#include <boost/assign/list_of.hpp>
#include <boost/iterator/indirect_iterator.hpp>
Expand Down
2 changes: 1 addition & 1 deletion src/instruction/aarch64_decode.C
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include "Instruction.h"
#include "InstructionDecoder.h"
#include "Register.h"
#include "dyn_regs.h"
#include "registers/aarch64_regs.h"
#include <boost/assign/list_of.hpp>
#include <boost/iterator/indirect_iterator.hpp>
#include <deque>
Expand Down
2 changes: 1 addition & 1 deletion src/instruction/aarch64_decode_ldst.C
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include "Instruction.h"
#include "InstructionDecoder.h"
#include "Register.h"
#include "dyn_regs.h"
#include "registers/aarch64_regs.h"
#include <boost/assign/list_of.hpp>
#include <boost/iterator/indirect_iterator.hpp>
#include <deque>
Expand Down
2 changes: 1 addition & 1 deletion src/instruction/aarch64_simd.C
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include "Instruction.h"
#include "InstructionDecoder.h"
#include "Register.h"
#include "dyn_regs.h"
#include "registers/aarch64_regs.h"
#include <boost/assign/list_of.hpp>
#include <boost/iterator/indirect_iterator.hpp>
#include <deque>
Expand Down
3 changes: 3 additions & 0 deletions src/instruction/fucompp.C
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@
#include "InstructionDecoder.h"
#include <boost/assign/list_of.hpp>
#include <deque>
#include "Architecture.h"
#include "registers/x86_regs.h"

using namespace Dyninst;
using namespace InstructionAPI;
using namespace boost;
Expand Down
3 changes: 2 additions & 1 deletion src/instruction/power_cft.C
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include "Instruction.h"
#include "InstructionDecoder.h"
#include "Register.h"

#include "registers/ppc32_regs.h"
#include <boost/assign/list_of.hpp>
#include <boost/iterator/indirect_iterator.hpp>
#include <deque>
Expand Down Expand Up @@ -160,6 +160,7 @@ test_results_t power_cft_Mutator::executeTest()
cfts.push_back(cftExpected(true, 0x404, false, false, false, true));
while(!decodedInsns.empty())
{
logerror("Parsing instruction '%s'\n", decodedInsns.front().format().c_str());
(void)(decodedInsns.front().getControlFlowTarget());
for(Instruction::cftConstIter curCFT = decodedInsns.front().cft_begin();
curCFT != decodedInsns.front().cft_end();
Expand Down
2 changes: 1 addition & 1 deletion src/instruction/power_decode.C
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include "Instruction.h"
#include "InstructionDecoder.h"
#include "Register.h"
#include "dyn_regs.h"
#include "registers/ppc32_regs.h"
#include <boost/assign/list_of.hpp>
#include <boost/iterator/indirect_iterator.hpp>
#include <deque>
Expand Down
12 changes: 11 additions & 1 deletion src/instruction/test_instruction_bind_eval.C
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,20 @@
#include "InstructionDecoder.h"
#include "Expression.h"
#include "Result.h"

#include "Architecture.h"
#include <boost/assign/list_of.hpp>
#include <boost/iterator/indirect_iterator.hpp>

#if defined(arch_x86_64_test)
# include "registers/x86_64_regs.h"
Dyninst::Architecture curArch = Dyninst::Arch_x86_64;
using namespace Dyninst::x86_64;
#elif defined(arch_x86_test)
# include "registers/x86_regs.h"
Dyninst::Architecture curArch = Dyninst::Arch_x86;
using namespace Dyninst::x86;
#endif

using namespace Dyninst;
using namespace InstructionAPI;
using namespace boost::assign;
Expand Down
4 changes: 4 additions & 0 deletions src/instruction/test_instruction_read_write.C
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@
#include "InstructionDecoder.h"
#include <boost/assign/list_of.hpp>
#include <deque>
#include "Architecture.h"
#include "registers/x86_regs.h"
#include "registers/x86_64_regs.h"

using namespace Dyninst;
using namespace InstructionAPI;
using namespace boost;
Expand Down

0 comments on commit eca2df1

Please sign in to comment.