This is my second recent change to TestStepOverWatchpoint.py, the first was to change the two global variables it is watching from 'char' to 'long' so they're more likely to be on separate words/doublewords of memory that can be watched indepdently. I believe this removes the need for the MIPS and S390X skips. The test was testing a combination of read and write watchpoints, stepping over a function that hits them, and then instruction stepping over a source line which hits them. But previously it was always starting with the read watchpoint in both of them, it didn't test the instruction-stepping for the read watchpoint. I now have to tests in TestStepOverWatchpoint.py, one which runs to the read-watchpoint function, sets that watchpoint, steps over another function which reads from that global, then instruction steps over a source line that reads from that global. The second test runs to the write-watchpoint function, sets that watchpoint. Steps over another function which writes to that global, then instruction steps over a source line that writes to that global. These are both xfailed on Darwin systems because watchpoints and hardware breakpoints are currently disabled by the kernel when instruction stepping.
26 lines
498 B
C
26 lines
498 B
C
long g_watch_me_read = 1;
|
|
long g_watch_me_write = 2;
|
|
long g_temp = 3;
|
|
|
|
void watch_read() {
|
|
g_temp = g_watch_me_read;
|
|
}
|
|
|
|
void watch_write() { g_watch_me_write = g_temp++; }
|
|
|
|
void read_watchpoint_testing() {
|
|
watch_read(); // break here for read watchpoints
|
|
g_temp = g_watch_me_read;
|
|
}
|
|
|
|
void watch_breakpoint_testing() {
|
|
watch_write(); // break here for modify watchpoints
|
|
g_watch_me_write = g_temp;
|
|
}
|
|
|
|
int main() {
|
|
read_watchpoint_testing();
|
|
watch_breakpoint_testing();
|
|
return 0;
|
|
}
|