From ece66d651004eac0210217c4d48babf4e80d1f2e Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 4 Dec 2015 13:28:07 -0800 Subject: gdbserver: set ptrace flags after creating inferiors Rename target_ops.arch_setup to .post_create_inferior. In the Linux hook, continue calling the low arch setup, then also set ptrace flags. This corrects the possibility of running without flags, demonstrated by a new test that would fail to catch a fork before. gdb/gdbserver/ChangeLog: 2015-12-04 Josh Stone * target.h (struct target_ops) : Rename to ... (struct target_ops) : ... this. (target_arch_setup): Rename to ... (target_post_create_inferior): ... this, calling post_create_inferior. * server.c (start_inferior): Update target_arch_setup calls to target_post_create_inferior. * linux-low.c (linux_low_ptrace_options): Forward declare. (linux_arch_setup): Update its comment for general use. (linux_post_create_inferior): New, run arch_setup and setup ptrace. (struct linux_target_ops): Use linux_post_create_inferior. * lynx-low.c (struct lynx_target_ops): Update arch_setup stub comment to post_create_inferior. * nto-low.c (struct nto_target_ops): Likewise. * spu-low.c (struct spu_target_ops): Likewise. * win32-low.c (struct win32_target_ops): Likewise. gdb/testsuite/ChangeLog: 2015-12-04 Josh Stone * gdb.base/catch-fork-static.exp: New. --- gdb/gdbserver/lynx-low.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gdb/gdbserver/lynx-low.c') diff --git a/gdb/gdbserver/lynx-low.c b/gdb/gdbserver/lynx-low.c index 36ab0a3..2940ce5 100644 --- a/gdb/gdbserver/lynx-low.c +++ b/gdb/gdbserver/lynx-low.c @@ -722,7 +722,7 @@ lynx_request_interrupt (void) static struct target_ops lynx_target_ops = { lynx_create_inferior, - NULL, /* arch_setup */ + NULL, /* post_create_inferior */ lynx_attach, lynx_kill, lynx_detach, -- cgit v1.1