Skip to content

Commit 402d3d8

Browse files
committed
reverse debug file write test
1 parent d4b082e commit 402d3d8

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

‎gdb/reverse.c‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ void signal_handler(int sig) {
2424

2525
int main(void) {
2626
int i, *ip;
27+
FILE *fp;
2728

2829
/* Variable changes. */
2930
i = 0;
@@ -59,6 +60,15 @@ int main(void) {
5960
printf("ip = %p\n", (void *)ip);
6061
printf("f = %p\n", (void *)(intptr_t)f);
6162

63+
/* Remove the file across replays to see if such side effects are re-done.
64+
* Answer: no. So rr treats stdout and stderr magically, and side effects
65+
* are not re-done in general. */
66+
fp = fopen(__FILE__ ".tmp", "w");
67+
fputs("a", fp);
68+
fclose(fp);
69+
70+
/* Check that we can reverse step this, found a problem in a closed setup,
71+
* but can't reproduce. */
6272
signal(SIGINT, signal_handler);
6373

6474
return EXIT_SUCCESS;

0 commit comments

Comments
 (0)