From c1955e179201e76330a10c400bfa92cab2afbee0 Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Thu, 3 May 2018 00:37:07 +0100 Subject: More procfs.c simplification There are only two architectures using procfs.c (i386/SPARC), and none of their corresponding nat files overrides any target method. Move the add_target calls to procfs.c directly. gdb/ChangeLog: 2018-05-02 Pedro Alves * i386-sol2-nat.c (_initialize_amd64_sol2_nat): Don't call procfs_target/add_target here. * procfs.c (procfs_target): Make static. (_initialize_procfs): Call add_target here. * procfs.h (struct target_ops): Remove forward declaration. (procfs_target): Remove declaration. * sparc-sol2-nat.c (_initialize_sparc_sol2_nat): Delete. --- gdb/procfs.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'gdb/procfs.c') diff --git a/gdb/procfs.c b/gdb/procfs.c index 0143f26..51c9ae8 100644 --- a/gdb/procfs.c +++ b/gdb/procfs.c @@ -171,7 +171,9 @@ procfs_auxv_parse (struct target_ops *ops, gdb_byte **readptr, } #endif -struct target_ops * +/* Create a procfs target. */ + +static struct target_ops * procfs_target (void) { struct target_ops *t = inf_child_target (); @@ -3770,6 +3772,8 @@ _initialize_procfs (void) _("Cancel a trace of entries into the syscall.")); add_com ("proc-untrace-exit", no_class, proc_untrace_sysexit_cmd, _("Cancel a trace of exits from the syscall.")); + + add_target (procfs_target ()); } /* =================== END, GDB "MODULE" =================== */ -- cgit v1.1