[PATCH 13/16 v2] Extended-remote exec catchpoints

Don Breazeal
2014-08-21T00:34:55Z

This patch implements exec catchpoints for extended-remote Linux targets.

The implementation follows the same appraoch used in patch 9 of this
series for fork catchpoints, implementing extended_remote target
routines for insert/remove. Existing host-side code and the support
for exec events introduced in patch 12 of this series takes care of
the rest.

Tested native, remote, extended-remote on x64 Ubuntu.

Thanks
--Don

gdb/
2014-08-20 Don Breazeal <donb@codesourcery.com>

* remote.c (extended_remote_insert_exec_catchpoint): New function.
(extended_remote_remove_exec_catchpoint): New function.
(_initialize_remote): Initialize target vector with new exec
catchpoint functions.

---
gdb/remote.c | 22 ++++++++++++++++++++++
1 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/gdb/remote.c b/gdb/remote.c
index d2256fd..60297ca 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -7938,6 +7938,24 @@ extended_remote_follow_fork (struct target_ops *ops, int follow_child,
return 0;
}

+/* Insert exec catchpoint target routine. If exec events are
+ enabled, just return success. */
+
+static int
+extended_remote_insert_exec_catchpoint (struct target_ops *ops, int pid)
+{
+ return !extended_remote_feature_supported (EXEC_EVENT);
+}
+
+/* Remove exec catchpoint target routine. Nothing to do, just
+ return success. */
+
+static int
+extended_remote_remove_exec_catchpoint (struct target_ops *ops, int pid)
+{
+ return 0;
+}
+
static void
remote_mourn (struct target_ops *ops)
{
@@ -11783,6 +11801,10 @@ Specify the serial device it is connected to (e.g. /dev/ttya).";
extended_remote_ops.to_remove_vfork_catchpoint
= extended_remote_remove_vfork_catchpoint;
extended_remote_ops.to_follow_fork = extended_remote_follow_fork;
+ extended_remote_ops.to_insert_exec_catchpoint
+ = extended_remote_insert_exec_catchpoint;
+ extended_remote_ops.to_remove_exec_catchpoint
+ = extended_remote_remove_exec_catchpoint;
extended_remote_ops.to_mourn_inferior = extended_remote_mourn;
extended_remote_ops.to_detach = extended_remote_detach;
extended_remote_ops.to_attach = extended_remote_attach;
--
1.7.0.4