diff --git a/src/core/sal/Listener.hpp b/src/core/sal/Listener.hpp index d291bcd2..fd9e835c 100644 --- a/src/core/sal/Listener.hpp +++ b/src/core/sal/Listener.hpp @@ -205,7 +205,7 @@ class BPSingleListener : public BPListener { protected: address_t m_WatchInstrPtr; public: - /** + /** * Creates a new breakpoint listener. * @param ip the instruction pointer of the breakpoint. If the control * flow reaches this address and its counter value is zero, the @@ -434,7 +434,7 @@ public: bool removeWatchNumber(unsigned troubleNum); /** * Returns the list of observed numbers. - * @return a const reference to the list which contains all observed numbers + * @return a const reference to the list which contains all observed numbers */ const std::vector& getWatchNumbers() const { return m_WatchNumbers; } /** @@ -453,7 +453,7 @@ public: * Sets the specific interrupt-/trap-number that actually triggered * the listener. Should not be used by experiment code. */ - void setTriggerNumber(unsigned troubleNum) { m_Data.setTriggerNumber(troubleNum); } + void setTriggerNumber(unsigned troubleNum) { m_Data.setTriggerNumber(troubleNum); } /** * Returns the specific interrupt-/trap-number that actually triggered * the listener. diff --git a/src/core/sal/t32/T32Constants.hpp b/src/core/sal/t32/T32Constants.hpp new file mode 100644 index 00000000..85c27375 --- /dev/null +++ b/src/core/sal/t32/T32Constants.hpp @@ -0,0 +1,40 @@ +/* + * Some constants for the T32 remote api calls. + * see also doc/t32_remote_api.pdf + */ +#ifndef __T32_CONSTANTS_HPP__ +#define __T32_CONSTANTS_HPP__ +namespace fail { + + namespace T32 { + //!< Breakpoint configuration + struct BP { + enum { + EXECUTION = 1<<0, + HLL_STEP = 1<<1, + SPOT = 1<<2, + READ = 1<<3, + WRITE = 1<<4, + ALPHA = 1<<5, + BETA = 1<<6, + CHARLY = 1<<7, + CLEAR = 1<<8, + }; + }; // struct BP + + + //!< Memory access variants + struct MEMACCESS { + enum { + DATA = 0, + PROGRAM = 1, + AD = 12, + AP = 13, + USR = 15, + }; + }; // struct MEMACCESS + + }; // namespace T32 +}; // namespace fail +#endif // __T32_CONSTANTS_HPP__ + diff --git a/src/core/sal/t32/T32Listener.ah b/src/core/sal/t32/T32Listener.ah index b4eded29..8eb2fef7 100644 --- a/src/core/sal/t32/T32Listener.ah +++ b/src/core/sal/t32/T32Listener.ah @@ -7,6 +7,7 @@ #if defined(BUILD_T32) && defined(CONFIG_EVENT_BREAKPOINTS) #include "../SALInst.hpp" +#include "T32Constants.hpp" aspect T32Listener { @@ -18,13 +19,14 @@ aspect T32Listener // Setup Breakpoint in T32 std::cout << "T32Listener::onAddition" << std::endl; // Enable Breakpoint - + T32_WriteBreakpoint( m_WatchInstrPtr, T32::MEMACCESS::PROGRAM, T32::BP::EXECUTION, 1); return true; } void onDeletion() { // Delete Breakpoint in T32 + T32_WriteBreakpoint( m_WatchInstrPtr, T32::MEMACCESS::PROGRAM, T32::BP::CLEAR, 1); } }; }; diff --git a/src/core/sal/t32/T32Memory.hpp b/src/core/sal/t32/T32Memory.hpp index aa32cdeb..68adc8d2 100644 --- a/src/core/sal/t32/T32Memory.hpp +++ b/src/core/sal/t32/T32Memory.hpp @@ -2,8 +2,8 @@ #define __T32_MEMORY_HPP__ #include "../Memory.hpp" -#include #include +#include "T32Constants.hpp" namespace fail { @@ -14,14 +14,6 @@ namespace fail { */ class T32MemoryManager : public MemoryManager { - enum ACCESS_CLASS { - data_access = 0, - program_access = 1, - AD_access = 12, - AP_access = 13, - USR_access = 15, - }; - public: size_t getPoolSize() const { return 0; /* TODO */ } @@ -36,7 +28,7 @@ public: void getBytes(guest_address_t addr, size_t cnt, void *dest) { - int access = data_access; // TODO what access class do we need?! + int access = T32::MEMACCESS::DATA; // TODO what access class do we need?! T32_ReadMemory( addr, access, (byte*)(dest), cnt); } @@ -47,7 +39,7 @@ public: void setBytes(guest_address_t addr, size_t cnt, void const *src) { - int access = data_access; // TODO what access class do we really need?! + int access = T32::MEMACCESS::DATA; // TODO what access class do we really need?! T32_WriteMemory(addr, access, (byte*)(src), cnt); }