5 static void breakme(int line
)
7 fprintf(stderr
, "breakme function called from line %d\n", line
);
10 static char undefined
[10] = "undefined";
11 int main (int argc
, char *argv
[])
16 read/write watchpoints at 4
17 write watchpoints at 8 */
19 breakme(__LINE__
); //break1
21 /* We verify read watchpoints are triggered at 0 and 4, not at 8 */
22 fprintf(stderr
, "before reading 0/4/8\n");
23 if (undefined
[0] == 'u')
24 fprintf(stderr
, "u: Expected value at 0\n");
26 fprintf(stderr
, "u: Unexpected value at 0\n");
28 if (undefined
[4] == 'f')
29 fprintf(stderr
, "f: Expected value at 4\n");
31 fprintf(stderr
, "f: Unexpected value at 4\n");
33 if (undefined
[8] == 'd')
34 fprintf(stderr
, "d: Expected value at 8\n");
36 fprintf(stderr
, "d: Unexpected value at 8\n");
39 /* We verify write watchpoints are triggered at 4 and 8, not at 0 */
40 fprintf(stderr
, "before writing 0\n");
43 fprintf(stderr
, "before writing 4\n");
46 fprintf(stderr
, "before writing 8\n");
49 fprintf(stderr
, "after writing 8\n");
51 /* after having remove the watchpoints, check we can read and write
53 fprintf(stderr
, "value %s\n", undefined
);
55 fprintf(stderr
, "before rewriting 0\n");
58 fprintf(stderr
, "before rewriting 4\n");
61 fprintf(stderr
, "before rewriting 8\n");
64 fprintf(stderr
, "value %s\n", undefined
);