This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb] Extended-remote catch exec
- From: Don Breazeal <donb at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 11 Sep 2015 18:16:41 -0000
- Subject: [binutils-gdb] Extended-remote catch exec
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=d46addbb52a1f6d970bcac583b0b00ff4326e116
commit d46addbb52a1f6d970bcac583b0b00ff4326e116
Author: Don Breazeal <donb@codesourcery.com>
Date: Fri Sep 11 11:06:02 2015 -0700
Extended-remote catch exec
This patch implements exec catchpoints for extended-remote Linux
targets. The implementation follows the same approach used for
fork catchpoints, implementing extended-remote target routines for
inserting and removing the catchpoints by just checking if exec events
are supported. Existing host-side code and previous support for
extended-remote exec events takes care of the rest.
gdb/ChangeLog:
* remote.c (remote_exec_event_p): New function.
(remote_insert_exec_catchpoint): New function.
(remote_remove_exec_catchpoint): New function.
(init_extended_remote_ops): Initialize extended_remote_ops
members to_insert_exec_catchpoint and
to_remove_exec_catchpoint.
Diff:
---
gdb/ChangeLog | 9 +++++++++
gdb/remote.c | 32 ++++++++++++++++++++++++++++++++
2 files changed, 41 insertions(+)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index aa6e5b1..0110528 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,4 +1,13 @@
2015-09-11 Don Breazeal <donb@codesourcery.com>
+
+ * remote.c (remote_exec_event_p): New function.
+ (remote_insert_exec_catchpoint): New function.
+ (remote_remove_exec_catchpoint): New function.
+ (init_extended_remote_ops): Initialize extended_remote_ops
+ members to_insert_exec_catchpoint and
+ to_remove_exec_catchpoint.
+
+2015-09-11 Don Breazeal <donb@codesourcery.com>
Luis Machado <lgustavo@codesourcery.com>
* infrun.c (follow_exec): Use process-style ptid for
diff --git a/gdb/remote.c b/gdb/remote.c
index 59004f9..db83e6b 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -1596,6 +1596,14 @@ remote_vfork_event_p (struct remote_state *rs)
return packet_support (PACKET_vfork_event_feature) == PACKET_ENABLE;
}
+/* Returns true if exec events are supported. */
+
+static int
+remote_exec_event_p (struct remote_state *rs)
+{
+ return packet_support (PACKET_exec_event_feature) == PACKET_ENABLE;
+}
+
/* Insert fork catchpoint target routine. If fork events are enabled
then return success, nothing more to do. */
@@ -1636,6 +1644,26 @@ remote_remove_vfork_catchpoint (struct target_ops *ops, int pid)
return 0;
}
+/* Insert exec catchpoint target routine. If exec events are
+ enabled, just return success. */
+
+static int
+remote_insert_exec_catchpoint (struct target_ops *ops, int pid)
+{
+ struct remote_state *rs = get_remote_state ();
+
+ return !remote_exec_event_p (rs);
+}
+
+/* Remove exec catchpoint target routine. Nothing to do, just
+ return success. */
+
+static int
+remote_remove_exec_catchpoint (struct target_ops *ops, int pid)
+{
+ return 0;
+}
+
/* Tokens for use by the asynchronous signal handlers for SIGINT. */
static struct async_signal_handler *async_sigint_remote_twice_token;
static struct async_signal_handler *async_sigint_remote_token;
@@ -12793,6 +12821,10 @@ Specify the serial device it is connected to (e.g. /dev/ttya).";
= remote_insert_vfork_catchpoint;
extended_remote_ops.to_remove_vfork_catchpoint
= remote_remove_vfork_catchpoint;
+ extended_remote_ops.to_insert_exec_catchpoint
+ = remote_insert_exec_catchpoint;
+ extended_remote_ops.to_remove_exec_catchpoint
+ = remote_remove_exec_catchpoint;
}
static int