Skip to content

Commit

Permalink
Add proccontrol/src/arm_process.C
Browse files Browse the repository at this point in the history
  • Loading branch information
hainest committed Apr 3, 2024
1 parent 11d9ac4 commit 00033c8
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 18 deletions.
37 changes: 36 additions & 1 deletion docs/proccontrol/developer/arm_process.h.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,45 @@ arm_process.h
.. cpp:function:: arm_thread(int_process *p, Dyninst::THR_ID t, Dyninst::LWP l)
.. cpp:function:: virtual ~arm_thread()
.. cpp:function:: virtual bool rmHWBreakpoint(hw_breakpoint *bp, bool suspend, std::set<response::ptr> &resps, bool &done)

.. warning:: Not implemented

.. cpp:function:: virtual bool addHWBreakpoint(hw_breakpoint *bp, bool resume, std::set<response::ptr> &resps, bool &done)

.. warning:: Not implemented

.. cpp:function:: virtual unsigned hwBPAvail(unsigned mode)
.. cpp:function:: virtual EventBreakpoint::ptr decodeHWBreakpoint(response::ptr &resp, bool have_reg = false, Dyninst::MachRegisterVal regval = 0)

.. warning:: Not implemented

.. cpp:function:: virtual EventBreakpoint::ptr decodeHWBreakpoint(response::ptr &resp, bool have_reg = false,\
Dyninst::MachRegisterVal regval = 0)

.. warning:: Not implemented

.. cpp:function:: virtual bool bpNeedsClear(hw_breakpoint *hwbp)
.. cpp:function:: void setCachedPC(Address pc)
.. cpp:function:: void clearCachedPC()
.. cpp:function:: bool haveCachedPC(Address &pc)


......

.. rubric::
The following a few of functions are used for emulated singlestep. The scenario
is quite similiar to what happens on PPC.

.. code::
----
ldaxr
...
stxr
----
.. cpp:function:: static bool atomicLoad(const instruction &insn)

Checks ``insn`` is exclusive load/store.

.. cpp:function:: static bool atomicStore(const instruction &insn)
.. cpp:function:: static void clear_ss_state_cb(int_thread *thr)
16 changes: 0 additions & 16 deletions proccontrol/src/arm_process.C
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
using namespace NS_aarch64;
using namespace std;

//constructors, blank functions
arm_process::arm_process(Dyninst::PID p, std::string e, std::vector<std::string> a,
std::vector<std::string> envp, std::map<int, int> f) :
int_process(p, e, a, envp, f)
Expand Down Expand Up @@ -89,17 +88,6 @@ bool arm_process::plat_convertToBreakpointAddress(Address &, int_thread *) {
return true;
}

// The following a few of functions are used for emulated
// singlestep. The scenario is quite similiar to what happens
// on PPC.
// ----
// ldaxr
// ...
// stxr
// ----
//

// to check if this insn is exclusive load/store
static bool atomicLoad(const instruction &insn) {
return insn.isAtomicLoad();
}
Expand Down Expand Up @@ -370,9 +358,6 @@ void arm_process::plat_getEmulatedSingleStepAsyncs(int_thread *, std::set<respon
}
}

// ------------------------------------
// arm thread functions implementations

arm_thread::arm_thread(int_process *p, Dyninst::THR_ID t, Dyninst::LWP l) :
int_thread(p, t, l), have_cached_pc(false), cached_pc(0)
{
Expand All @@ -382,7 +367,6 @@ arm_thread::~arm_thread()
{
}

//#warning "HWBreakpoint is not supported now."
bool arm_thread::rmHWBreakpoint(hw_breakpoint *,
bool,
std::set<response::ptr> &,
Expand Down
1 change: 0 additions & 1 deletion proccontrol/src/arm_process.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ class arm_process : virtual public int_process

virtual bool plat_convertToBreakpointAddress(Address &addr, int_thread *thr);

//for emulated SS
virtual void cleanupSSOnContinue(int_thread *thr);
virtual void registerSSClearCB();
virtual async_ret_t readPCForSS(int_thread *thr, Address &pc);
Expand Down

0 comments on commit 00033c8

Please sign in to comment.