Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Don Breazeal <donb@codesourcery.com>
To: <gdb-patches@sourceware.org>
Subject: [pushed][PATCH v3 2/4] Extended-remote exec catchpoints
Date: Fri, 11 Sep 2015 18:38:00 -0000	[thread overview]
Message-ID: <1441996698-12694-2-git-send-email-donb@codesourcery.com> (raw)
In-Reply-To: <1441996698-12694-1-git-send-email-donb@codesourcery.com>

Here is what I pushed.
Thanks,
--Don

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.

Tested on x86_64 GNU/Linux with native, native-gdbserver, and
native-extended-gdbserver targets.

gdb/
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.

---
 gdb/remote.c | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

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
-- 
1.8.1.1


  reply	other threads:[~2015-09-11 18:38 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-15 21:49 [PATCH 0/5] Extended-remote follow exec Don Breazeal
2015-07-15 21:50 ` [PATCH 3/5] Extended-remote support for exec event tests Don Breazeal
2015-07-15 21:50 ` [PATCH 2/5] Extended-remote exec catchpoints Don Breazeal
2015-08-13 15:00   ` Pedro Alves
2015-07-15 21:50 ` [PATCH 1/5] Extended-remote exec events Don Breazeal
2015-07-16 14:01   ` Yao Qi
2015-07-16 15:52     ` Don Breazeal
2015-07-16 16:35       ` Yao Qi
2015-07-16 17:06         ` Don Breazeal
2015-07-17 11:55           ` Yao Qi
2015-07-15 21:51 ` [PATCH 5/5] Extended-remote exec event docs Don Breazeal
2015-07-16  2:39   ` Eli Zaretskii
2015-07-15 21:51 ` [PATCH 4/5] Eliminate spurious warnings from remote exec Don Breazeal
2015-07-30 23:19 ` [PATCH v2 0/5] Extended-remote exec events Don Breazeal
2015-07-30 23:19   ` [PATCH v2 2/5] Extended-remote exec catchpoints Don Breazeal
2015-07-30 23:19   ` [PATCH v2 1/5] Extended-remote follow exec Don Breazeal
2015-08-13 14:50     ` Pedro Alves
2015-07-30 23:20   ` [PATCH v2 3/5] Extended-remote support for exec event tests Don Breazeal
2015-08-13 15:22     ` Pedro Alves
2015-07-30 23:20   ` [PATCH v2 5/5] Extended-remote exec event docs Don Breazeal
2015-07-31  6:36     ` Eli Zaretskii
2015-07-31 17:06       ` Don Breazeal
2015-08-13 15:43     ` Pedro Alves
2015-07-30 23:20   ` [PATCH v2 4/5] Eliminate spurious warnings from remote exec Don Breazeal
2015-08-13 15:38     ` Pedro Alves
2015-09-09 23:05   ` [PATCH v3 0/4] Extended-remote exec events Don Breazeal
2015-09-09 23:06     ` [PATCH v3 3/4] Extended-remote support for exec event tests Don Breazeal
2015-09-10 13:26       ` Pedro Alves
2015-09-09 23:06     ` [PATCH v3 2/4] Extended-remote exec catchpoints Don Breazeal
2015-09-09 23:06     ` [PATCH v3 4/4] Extended-remote exec event docs Don Breazeal
2015-09-10 15:23       ` Eli Zaretskii
2015-09-09 23:06     ` [PATCH v3 1/4] Extended-remote follow exec Don Breazeal
     [not found]       ` <55F17AFA.5080102@redhat.com>
2015-09-10 22:56         ` Don Breazeal
2015-09-10 23:00           ` Don Breazeal
2015-09-11  8:34           ` Pedro Alves
2015-09-11 18:38             ` [pushed][PATCH " Don Breazeal
2015-09-11 18:38               ` Don Breazeal [this message]
2015-09-11 18:38               ` [pushed][PATCH v3 3/4] Extended-remote exec test Don Breazeal
2015-09-15 15:45                 ` Pedro Alves
2015-09-15 15:53                   ` Don Breazeal
2015-09-15 15:58                     ` Pedro Alves
2015-09-15 16:00                       ` Breazeal, Don
2015-09-15 16:28                         ` Pedro Alves
2015-09-11 18:39               ` [pushed][PATCH v3 4/4] Extended-remote exec event docs Don Breazeal
2015-09-15  8:56               ` [pushed][PATCH v3 1/4] Extended-remote follow exec Yao Qi
2015-09-15 16:12                 ` Don Breazeal
2015-09-15 16:31                   ` Yao Qi
2015-09-30 16:20               ` Pedro Alves
2015-09-30 16:22                 ` Breazeal, Don
2016-12-08 11:54               ` Thomas Schwinge
2017-02-17 16:45                 ` Pedro Alves
2019-02-14 16:42                   ` Thomas Schwinge
2019-02-14 17:26                     ` Tom Tromey
2019-02-14 23:11                       ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1441996698-12694-2-git-send-email-donb@codesourcery.com \
    --to=donb@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox