This repository has been archived by the owner on Sep 29, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
GdbARMPlugin.h
executable file
·68 lines (62 loc) · 1.98 KB
/
GdbARMPlugin.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/* heavily based on BochsIA32Plugin.h */
#define NoError 0
#define ExecutionError 1
#define BadCPUInstance 2
#define MemoryBoundsError 3
#define PanicError 4
#define UnsupportedOperationError 5
#define SomethingLoggedError 6
// The library is compiled with TFlag, therefore, we also need to set it.
#define MODET
#if !defined(ulong)
typedef unsigned long ulong;
#endif
extern ulong minReadAddress, minWriteAddress;
extern int gdb_log_printf(void* stream, const char * format, ...);
/*
* Answer a pointer to a new ARMulator CPU (an instance of typedef ARMul_State)
*/
extern void *newCPU();
/*
* reset the cpu to register contents 0, protected 32-bit mode.
*/
extern int resetCPU(void *cpu);
/*
* Single-step *cpu (an ARMul_state instance) using memory as its memory.
* Answer 0 on success, or an integer error code if something went awry.
*/
extern int singleStepCPUInSizeMinAddrReadWrite(void *cpu, void *memory,
ulong byteSize, ulong minReadAddr, ulong minWriteAddr);
/*
* Run *cpu (an ARMul_state instance) using memory as its memory.
* Answer an integer error code when the processor hits some exception.
* Answer 0 when it is interrupted.
*/
extern int runCPUInSizeMinAddrReadWrite(void *cpu, void *memory,
ulong byteSize, ulong minReadAddr, ulong minWriteAddr);
/*
* Flush any icache entries from start to end
*/
extern void flushICacheFromTo(void *cpu, ulong strt, ulong nd);
/*
* force runCPUInSize to exit asap. Used by interrupts.
*/
extern void forceStopRunning();
/*
* The previous entry in the interruptCheckChain so forceStopRunning can chain.
*/
extern void (*prevInterruptCheckChain)();
/*
* Disassemble the instruction at address in memory, writing the output to the
* log.
*/
extern int disassembleForAtInSize(void *cpu, ulong laddr,
void *memory, ulong byteSize);
/*
* The saved error if the previous singleStepIn failed.
*/
extern int errorAcorn();
/*
* The current log (if singleStep failed with SomethingLoggedError).
*/
extern char *getlog(long *len);