2017-10-12 Simon Marchi <simon.marchi@ericsson.com>
+ * linux-low.h (struct linux_target_ops) <delete_process>: New
+ field.
+ * linux-low.c (linux_mourn): Call the_low_target.delete_process.
+ * linux-aarch64-low.c (aarch64_linux_delete_process): New.
+ (struct linux_target_ops): Add delete_process callback.
+ * linux-arm-low.c (arm_delete_process): New.
+ (struct linux_target_ops): Add delete_process callback.
+ * linux-bfin-low.c (struct linux_target_ops): Likewise.
+ * linux-crisv32-low.c (struct linux_target_ops): Likewise.
+ * linux-m32r-low.c (struct linux_target_ops): Likewise.
+ * linux-mips-low.c (mips_linux_delete_process): New.
+ (struct linux_target_ops): Add delete_process callback.
+ * linux-ppc-low.c (struct linux_target_ops): Likewise.
+ * linux-s390-low.c (struct linux_target_ops): Likewise.
+ * linux-sh-low.c (struct linux_target_ops): Likewise.
+ * linux-tic6x-low.c (struct linux_target_ops): Likewise.
+ * linux-tile-low.c (struct linux_target_ops): Likewise.
+ * linux-x86-low.c (x86_linux_delete_process): New.
+ (struct linux_target_ops): Add delete_process callback.
+ * linux-xtensa-low.c (struct linux_target_ops): Likewise.
+
+2017-10-12 Simon Marchi <simon.marchi@ericsson.com>
+
* linux-aarch64-low.c (the_low_target): Add thread delete
callback.
* linux-arm-low.c (arm_delete_thread): New function.
return 0;
}
-/* Implementation of linux_target_ops method "linux_new_process". */
+/* Implementation of linux_target_ops method "new_process". */
static struct arch_process_info *
aarch64_linux_new_process (void)
return info;
}
+/* Implementation of linux_target_ops method "delete_process". */
+
+static void
+aarch64_linux_delete_process (struct arch_process_info *info)
+{
+ xfree (info);
+}
+
/* Implementation of linux_target_ops method "linux_new_fork". */
static void
NULL, /* supply_ptrace_register */
aarch64_linux_siginfo_fixup,
aarch64_linux_new_process,
+ aarch64_linux_delete_process,
aarch64_linux_new_thread,
aarch64_linux_delete_thread,
aarch64_linux_new_fork,
return info;
}
+/* Called when a process is being deleted. */
+
+static void
+arm_delete_process (struct arch_process_info *info)
+{
+ xfree (info);
+}
+
/* Called when a new thread is detected. */
static void
arm_new_thread (struct lwp_info *lwp)
NULL, /* supply_ptrace_register */
NULL, /* siginfo_fixup */
arm_new_process,
+ arm_delete_process,
arm_new_thread,
arm_delete_thread,
arm_new_fork,
NULL, /* supply_ptrace_register */
NULL, /* siginfo_fixup */
NULL, /* new_process */
+ NULL, /* delete_process */
NULL, /* new_thread */
NULL, /* delete_thread */
NULL, /* new_fork */
NULL, /* supply_ptrace_register */
NULL, /* siginfo_fixup */
NULL, /* new_process */
+ NULL, /* delete_process */
NULL, /* new_thread */
NULL, /* delete_thread */
NULL, /* new_fork */
/* Freeing all private data. */
priv = process->priv;
- free (priv->arch_private);
+ if (the_low_target.delete_process != NULL)
+ the_low_target.delete_process (priv->arch_private);
+ else
+ gdb_assert (priv->arch_private == NULL);
free (priv);
process->priv = NULL;
allocate it here. */
struct arch_process_info * (*new_process) (void);
+ /* Hook to call when a process is being deleted. If extra per-process
+ architecture-specific data is needed, delete it here. */
+ void (*delete_process) (struct arch_process_info *info);
+
/* Hook to call when a new thread is detected.
If extra per-thread architecture-specific data is needed,
allocate it here. */
NULL, /* supply_ptrace_register */
NULL, /* siginfo_fixup */
NULL, /* new_process */
+ NULL, /* delete_process */
NULL, /* new_thread */
NULL, /* delete_thread */
NULL, /* new_fork */
return info;
}
+/* This is the implementation of linux_target_ops method
+ delete_process. */
+
+static void
+mips_linux_delete_process (struct arch_process_info *info)
+{
+ xfree (info);
+}
+
/* This is the implementation of linux_target_ops method new_thread.
Mark the watch registers as changed, so the threads' copies will
be updated. */
NULL,
NULL, /* siginfo_fixup */
mips_linux_new_process,
+ mips_linux_delete_process,
mips_linux_new_thread,
mips_linux_delete_thread,
mips_linux_new_fork,
ppc_supply_ptrace_register,
NULL, /* siginfo_fixup */
NULL, /* new_process */
+ NULL, /* delete_process */
NULL, /* new_thread */
NULL, /* delete_thread */
NULL, /* new_fork */
s390_supply_ptrace_register,
NULL, /* siginfo_fixup */
NULL, /* new_process */
+ NULL, /* delete_process */
NULL, /* new_thread */
NULL, /* delete_thread */
NULL, /* new_fork */
NULL, /* supply_ptrace_register */
NULL, /* siginfo_fixup */
NULL, /* new_process */
+ NULL, /* delete_process */
NULL, /* new_thread */
NULL, /* delete_thread */
NULL, /* new_fork */
NULL, /* supply_ptrace_register */
NULL, /* siginfo_fixup */
NULL, /* new_process */
+ NULL, /* delete_process */
NULL, /* new_thread */
NULL, /* delete_thread */
NULL, /* new_fork */
NULL, /* supply_ptrace_register */
NULL, /* siginfo_fixup */
NULL, /* new_process */
+ NULL, /* delete_process */
NULL, /* new_thread */
NULL, /* delete_thread */
NULL, /* new_fork */
return info;
}
+/* Called when a process is being deleted. */
+
+static void
+x86_linux_delete_process (struct arch_process_info *info)
+{
+ xfree (info);
+}
+
/* Target routine for linux_new_fork. */
static void
/* need to fix up i386 siginfo if host is amd64 */
x86_siginfo_fixup,
x86_linux_new_process,
+ x86_linux_delete_process,
x86_linux_new_thread,
x86_linux_delete_thread,
x86_linux_new_fork,
NULL, /* supply_ptrace_register */
NULL, /* siginfo_fixup */
NULL, /* new_process */
+ NULL, /* delete_process */
NULL, /* new_thread */
NULL, /* delete_thread */
NULL, /* new_fork */