NetBurner 3.5.8
PDF Version
Toggle main menu visibility
coldfire/include/debugtraps.h
1
/*NB_REVISION*/
2
3
/*NB_COPYRIGHT*/
4
#ifndef DBUGTRAP_H
5
#define DBUGTRAP_H
6
7
void
SetAddressWrittenTrap(uint32_t addr);
8
void
SetAddressWriteRangeTrap(uint32_t startaddr, uint32_t endaddr);
9
void
SetAddressReadTrap(uint32_t addr);
10
void
SetAddressReadRangeTrap(uint32_t startaddr, uint32_t endaddr);
11
12
/* Call this macro to monitor writes to a single variable */
13
/* You may only monitor ONE VARIABLE */
14
/* You may not write to this variable after making this call unless */
15
/* You first use the BEFORE_WRITING_MONITORED_VAR macro */
16
#define MONITOR_VAR_WRITES(x) SetAddressWrittenTrap((uint32_t)&x);
17
18
/* use this before writing to a monitored var */
19
#define BEFORE_WRITING_MONITORED_VAR(x) \
20
asm(" move.w #0x2700,%sr "); \
21
SetAddressWrittenTrap(0);
22
23
/* Use this after writing to a monitored var */
24
#define AFTER_WRITING_MONITORED_VAR(x) \
25
asm(" nop"); \
26
SetAddressWrittenTrap((uint32_t)&x); \
27
asm(" move.w (OSISRLevel),%d0 "); \
28
asm(" move.w %d0,%sr ");
29
30
#endif
arch
coldfire
include
debugtraps.h
Generated by
1.18.0