Refactor the debugserver watchpiont support in anticipating of adding support for AArch64 MASK hardware watchpoints to watch larger regions of memory. debugserver already had support for handling a request to watch an unaligned region of memory up to 8 bytes using Byte Address Select watchpoints - it would split an unaligned watch request into two aligned doublewords that could be watched with two hardware watchpoints using the BAS specification. This patch generalizes that code for properly aligning, and possibly splitting, a watchpoint request into two hardware watchpoints to handle any size request. And separates out the specifics about BAS watchpoints into its own method, so a sibling method for MASK watchpoints can be dropped in next. Differential Revision: https://reviews.llvm.org/D149040 rdar://108233371
18 lines
339 B
C
18 lines
339 B
C
#include <stdint.h>
|
|
#include <stdio.h>
|
|
int main() {
|
|
union {
|
|
uint8_t bytebuf[16];
|
|
uint16_t shortbuf[8];
|
|
uint64_t dwordbuf[2];
|
|
} a;
|
|
a.dwordbuf[0] = a.dwordbuf[1] = 0;
|
|
a.bytebuf[0] = 0; // break here
|
|
for (int i = 0; i < 8; i++) {
|
|
a.shortbuf[i] += i;
|
|
}
|
|
for (int i = 0; i < 8; i++) {
|
|
a.shortbuf[i] += i;
|
|
}
|
|
}
|