1 /* Test case for forgotten hw-watchpoints after fork()-off of a process.
3 Copyright 2012-2015 Free Software Foundation, Inc.
5 This file is part of GDB.
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, see <http://www.gnu.org/licenses/>. */
22 #include <sys/types.h>
28 #include "watchpoint-fork.h"
34 int exit_code
= 42 + nr
;
43 printf ("child%d: %d\n", nr
, (int) getpid ());
44 /* Delay to get both the "child%d" and "parent%d" message printed without
45 a race breaking expect by its endless wait on `$gdb_prompt$':
46 Breakpoint 3, marker () at ../../../gdb/testsuite/gdb.threads/watchpoint-fork.c:33
48 (gdb) parent2: 14223 */
52 /* We must not get caught here (against a forgotten breakpoint). */
58 printf ("parent%d: %d\n", nr
, (int) child
);
59 /* Delay to get both the "child%d" and "parent%d" message printed, see
64 pid_got
= wait (&status
);
65 assert (pid_got
== child
);
66 assert (WIFEXITED (status
));
67 assert (WEXITSTATUS (status
) == exit_code
);
69 /* We must get caught here (against a false watchpoint removal). */
This page took 0.035707 seconds and 4 git commands to generate.