T32: Dissassembler to evaluate memory instructions.
For the T32 variant we have to evaluate the memory access instruction to find out, which memory address was accessed. Dissassmbly by OpenOCDs arm_disassembler.hpp/.cc: - fine for ARM / Thumb1 - needs fixes for Thumb2 :( (currently doing that..)
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
#include "T32Connector.hpp"
|
||||
#include <iostream>
|
||||
#include <t32.h>
|
||||
#include "sal/MemoryInstruction.hpp"
|
||||
|
||||
using namespace fail;
|
||||
|
||||
@ -93,7 +94,6 @@ void T32Connector::brk() {
|
||||
#include "sal/t32/T32Constants.hpp"
|
||||
|
||||
void T32Connector::test() {
|
||||
|
||||
}
|
||||
|
||||
/* Default T32 error handler */
|
||||
|
||||
@ -23,6 +23,8 @@
|
||||
|
||||
#include "T32Connector.hpp"
|
||||
#include "t32config.hpp"
|
||||
#include "sal/MemoryInstruction.hpp"
|
||||
#include "util/Disassembler.hpp"
|
||||
|
||||
using namespace std;
|
||||
using namespace fail;
|
||||
@ -96,6 +98,8 @@ int main(int argc, char** argv){
|
||||
// The experiments/traces hopefully set some Breakpoints, we can react on.
|
||||
// We may also provide a timeout, if a TimerListener was set wanted.
|
||||
|
||||
MemoryInstruction mem;
|
||||
address_t ip;
|
||||
|
||||
while(1) {
|
||||
// Start execution (with next timeout, if any)
|
||||
@ -105,8 +109,11 @@ int main(int argc, char** argv){
|
||||
// Evaluate state.
|
||||
t32.test();// TODO
|
||||
// Call appropriate callback of the SimulatorController.
|
||||
fail::simulator.onBreakpoint(&fail::simulator.getCPU(0), fail::simulator.getCPU(0).getInstructionPointer(), fail::ANY_ADDR);
|
||||
// TODO fail::simulator.onMemoryAccess(&fail::simulator.getCPU(0), 0x20002074, 1, true, fail::simulator.getCPU(0).getInstructionPointer());
|
||||
ip = fail::simulator.getCPU(0).getInstructionPointer();
|
||||
fail::simulator.onBreakpoint(&fail::simulator.getCPU(0), ip , fail::ANY_ADDR);
|
||||
if( meminstruction.eval(ip, mem) ) {
|
||||
fail::simulator.onMemoryAccess(&fail::simulator.getCPU(0), mem.getAddress(), mem.getWidth(), mem.isWriteAccess(), ip );
|
||||
}
|
||||
}
|
||||
|
||||
cout << "[T32 Backend] After startup" << endl;
|
||||
|
||||
Reference in New Issue
Block a user