<pre style='margin:0'>
Rainer Müller (raimue) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/defab74d7e9f649efba07635867e7d324a5d0e36">https://github.com/macports/macports-ports/commit/defab74d7e9f649efba07635867e7d324a5d0e36</a></p>
<pre style="white-space: pre; background: #F8F8F8">The following commit(s) were added to refs/heads/master by this push:
<span style='display:block; white-space:pre;color:#404040;'> new defab74 gdb: add missing patch file
</span>defab74 is described below
<span style='display:block; white-space:pre;color:#808000;'>commit defab74d7e9f649efba07635867e7d324a5d0e36
</span>Author: Rainer Müller <raimue@macports.org>
AuthorDate: Mon Jun 19 02:03:40 2017 +0200
<span style='display:block; white-space:pre;color:#404040;'> gdb: add missing patch file
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> Forgot to add this in 380ef99dde4cec0516cba66797d478ff0d97239d.
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> See: https://trac.macports.org/ticket/54217
</span>---
devel/gdb/files/patch-gdb-darwin-nat.c.diff | 544 ++++++++++++++++++++++++++++
1 file changed, 544 insertions(+)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/devel/gdb/files/patch-gdb-darwin-nat.c.diff b/devel/gdb/files/patch-gdb-darwin-nat.c.diff
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 0000000..686fde9
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/devel/gdb/files/patch-gdb-darwin-nat.c.diff
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,544 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From d94e8653463e33dd3e10ce4001217e5d929d0883 Mon Sep 17 00:00:00 2001
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From: Tristan Gingold <gingold@adacore.com>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Date: Wed, 9 Nov 2016 10:25:00 +0100
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Subject: [PATCH 1/1] darwin-nat.c: handle Darwin 16 (aka Sierra).
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Support message from new task and dead name notification on task of an
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+existing process.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+With Sierra, exec(2) terminate the current task and creates a new one.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+'set startup-with-shell off' must still be used on Darwin 16.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+2016-11-09 Tristan Gingold <gingold@adacore.com>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * darwin-nat.c (find_inferior_task_it): Fix indentation.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ (find_inferior_notify_it): Remove.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ (find_inferior_pid_it): New function.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ (darwin_find_inferior_by_notify): Remove.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ (darwin_find_inferior_by_pid): New function.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ (darwin_find_new_inferior): New function.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ (darwin_check_message_ndr): New function from
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ darwin_decode_exception_message.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ (darwin_decode_exception_message): Call darwin_check_message_ndr.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Handle SIGTRAP addressed to an unknown task (when a task spawned).
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ (darwin_decode_notify_message): New function.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ (darwin_decode_message): Handle unknown task.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ (darwin_deallocate_threads): New function from darwin_mourn_inferior.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ (darwin_mourn_inferior): Use darwin_deallocate_threads and
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ darwin_deallocate_exception_ports.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ (darwin_deallocate_exception_ports): New function from
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ darwin_mourn_inferior.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ (darwin_setup_exceptions): New function from darwin_attach_pid.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ (darwin_setup_request_notification): Likewise.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ (darwin_attach_pid): Call darwin_setup_request_notification and
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ darwin_setup_request_notification.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+---
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ gdb/darwin-nat.c | 342 +++++++++++++++++++++++++++++++++++++++++++------------
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ 1 file changed, 267 insertions(+), 75 deletions(-)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/gdb/darwin-nat.c b/gdb/darwin-nat.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 590c2ad..4fc1685 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- gdb/darwin-nat.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ gdb/darwin-nat.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -114,6 +114,11 @@ static int darwin_thread_alive (struct target_ops *ops, ptid_t tpid);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ static void darwin_encode_reply (mig_reply_error_t *reply,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ mach_msg_header_t *hdr, integer_t code);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++static void darwin_setup_request_notification (struct inferior *inf);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++static void darwin_deallocate_exception_ports (darwin_inferior *inf);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++static void darwin_setup_exceptions (struct inferior *inf);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++static void darwin_deallocate_threads (struct inferior *inf);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* Target operations for Darwin. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ static struct target_ops *darwin_ops;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -320,6 +325,7 @@ darwin_check_new_threads (struct inferior *inf)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Full handling: detect new threads, remove dead threads. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ thread_vec = VEC_alloc (darwin_thread_t, new_nbr);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ for (new_ix = 0, old_ix = 0; new_ix < new_nbr || old_ix < old_nbr;)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -365,15 +371,22 @@ darwin_check_new_threads (struct inferior *inf)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ pti->gdb_port = new_id;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ pti->msg_state = DARWIN_RUNNING;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- /* Add a new thread unless this is the first one ever met. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (!(old_nbr == 0 && new_ix == 0))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- tp = add_thread_with_info (ptid_build (inf->pid, 0, new_id), pti);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (old_nbr == 0 && new_ix == 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* A ptid is create when the inferior is started (see
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ fork-child.c) with lwp=tid=0. This ptid will be renamed
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ later by darwin_init_thread_list (). */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ tp = find_thread_ptid (ptid_build (inf->pid, 0, 0));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ gdb_assert (tp);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ gdb_assert (tp->priv == NULL);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ tp->priv = pti;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Add the new thread. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tp = add_thread_with_info
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ (ptid_build (inf->pid, 0, new_id), pti);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ VEC_safe_push (darwin_thread_t, thread_vec, pti);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ new_ix++;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ continue;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -403,13 +416,13 @@ darwin_check_new_threads (struct inferior *inf)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ static int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ find_inferior_task_it (struct inferior *inf, void *port_ptr)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return inf->priv->task == *(task_t*)port_ptr;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return inf->priv->task == *(task_t *)port_ptr;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ static int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-find_inferior_notify_it (struct inferior *inf, void *port_ptr)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++find_inferior_pid_it (struct inferior *inf, void *pid_ptr)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return inf->priv->notify_port == *(task_t*)port_ptr;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return inf->pid == *(int *)pid_ptr;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* Return an inferior by task port. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -419,11 +432,11 @@ darwin_find_inferior_by_task (task_t port)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return iterate_over_inferiors (&find_inferior_task_it, &port);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-/* Return an inferior by notification port. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++/* Return an inferior by pid port. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ static struct inferior *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-darwin_find_inferior_by_notify (mach_port_t port)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++darwin_find_inferior_by_pid (int pid)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return iterate_over_inferiors (&find_inferior_notify_it, &port);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return iterate_over_inferiors (&find_inferior_pid_it, &pid);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* Return a thread by port. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -557,6 +570,69 @@ darwin_dump_message (mach_msg_header_t *hdr, int disp_body)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++/* Adjust inferior data when a new task was created. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++static struct inferior *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++darwin_find_new_inferior (task_t task_port, thread_t thread_port)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int task_pid;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ struct inferior *inf;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ kern_return_t kret;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ mach_port_t prev;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Find the corresponding pid. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ kret = pid_for_task (task_port, &task_pid);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (kret != KERN_SUCCESS)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ MACH_CHECK_ERROR (kret);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Find the inferior for this pid. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ inf = darwin_find_inferior_by_pid (task_pid);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (inf == NULL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Deallocate saved exception ports. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ darwin_deallocate_exception_ports (inf->priv);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* No need to remove dead_name notification, but still... */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ kret = mach_port_request_notification (gdb_task, inf->priv->task,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ MACH_NOTIFY_DEAD_NAME, 0,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ MACH_PORT_NULL,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ MACH_MSG_TYPE_MAKE_SEND_ONCE,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ &prev);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (kret != KERN_INVALID_ARGUMENT)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ MACH_CHECK_ERROR (kret);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Replace old task port. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ kret = mach_port_deallocate (gdb_task, inf->priv->task);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ MACH_CHECK_ERROR (kret);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ inf->priv->task = task_port;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ darwin_setup_request_notification (inf);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ darwin_setup_exceptions (inf);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return inf;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++/* Check data representation. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++static int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++darwin_check_message_ndr (NDR_record_t *ndr)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (ndr->mig_vers != NDR_PROTOCOL_2_0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ || ndr->if_vers != NDR_PROTOCOL_2_0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ || ndr->mig_encoding != NDR_record.mig_encoding
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ || ndr->int_rep != NDR_record.int_rep
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ || ndr->char_rep != NDR_record.char_rep
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ || ndr->float_rep != NDR_record.float_rep)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return -1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++/* Decode an exception message. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ static int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ darwin_decode_exception_message (mach_msg_header_t *hdr,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ struct inferior **pinf,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -593,12 +669,7 @@ darwin_decode_exception_message (mach_msg_header_t *hdr,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* Check data representation. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ndr = (NDR_record_t *)(desc + 2);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (ndr->mig_vers != NDR_PROTOCOL_2_0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- || ndr->if_vers != NDR_PROTOCOL_2_0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- || ndr->mig_encoding != NDR_record.mig_encoding
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- || ndr->int_rep != NDR_record.int_rep
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- || ndr->char_rep != NDR_record.char_rep
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- || ndr->float_rep != NDR_record.float_rep)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (darwin_check_message_ndr (ndr) != 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return -1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* Ok, the hard work. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -607,14 +678,33 @@ darwin_decode_exception_message (mach_msg_header_t *hdr,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ task_port = desc[1].name;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ thread_port = desc[0].name;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- /* We got new rights to the task, get rid of it. Do not get rid of thread
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- right, as we will need it to find the thread. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- kret = mach_port_deallocate (mach_task_self (), task_port);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- MACH_CHECK_ERROR (kret);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* Find process by port. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ inf = darwin_find_inferior_by_task (task_port);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ *pinf = inf;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (inf == NULL && data[0] == EXC_SOFTWARE && data[1] == 2
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ && data[2] == EXC_SOFT_SIGNAL && data[3] == SIGTRAP)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Not a known inferior, but a sigtrap. This happens on darwin 16.1.0,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ as a new Mach task is created when a process exec. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ inf = darwin_find_new_inferior (task_port, thread_port);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ *pinf = inf;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (inf == NULL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Deallocate task_port, unless it was saved. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ kret = mach_port_deallocate (mach_task_self (), task_port);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ MACH_CHECK_ERROR (kret);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* We got new rights to the task, get rid of it. Do not get rid of
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ thread right, as we will need it to find the thread. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ kret = mach_port_deallocate (mach_task_self (), task_port);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ MACH_CHECK_ERROR (kret);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (inf == NULL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* Not a known inferior. This could happen if the child fork, as
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -623,6 +713,10 @@ darwin_decode_exception_message (mach_msg_header_t *hdr,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ kern_return_t kret;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ mig_reply_error_t reply;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ inferior_debug
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ (4, _("darwin_decode_exception_message: unknown task 0x%x\n"),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ task_port);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* Free thread port (we don't know it). */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ kret = mach_port_deallocate (mach_task_self (), thread_port);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ MACH_CHECK_ERROR (kret);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -676,6 +770,45 @@ darwin_decode_exception_message (mach_msg_header_t *hdr,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++/* Decode dead_name notify message. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++static int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++darwin_decode_notify_message (mach_msg_header_t *hdr, struct inferior **pinf)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ NDR_record_t *ndr = (NDR_record_t *)(hdr + 1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ integer_t *data = (integer_t *)(ndr + 1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ struct inferior *inf;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ darwin_thread_t *thread;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ task_t task_port;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ thread_t thread_port;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ kern_return_t kret;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int i;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Check message header. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (hdr->msgh_bits & MACH_MSGH_BITS_COMPLEX)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return -1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Check descriptors. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (hdr->msgh_size < (sizeof (*hdr) + sizeof (*ndr) + sizeof (integer_t)))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return -2;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Check data representation. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (darwin_check_message_ndr (ndr) != 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return -3;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ task_port = data[0];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Find process by port. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ inf = darwin_find_inferior_by_task (task_port);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ *pinf = inf;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Check message destination. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (inf != NULL && hdr->msgh_local_port != inf->priv->notify_port)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return -4;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ static void
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ darwin_encode_reply (mig_reply_error_t *reply, mach_msg_header_t *hdr,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ integer_t code)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -986,10 +1119,27 @@ darwin_decode_message (mach_msg_header_t *hdr,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ else if (hdr->msgh_id == 0x48)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* MACH_NOTIFY_DEAD_NAME: notification for exit. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int res;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ res = darwin_decode_notify_message (hdr, &inf);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (res < 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Should not happen... */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ printf_unfiltered
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ (_("darwin_wait: ill-formatted message (id=0x%x, res=%d)\n"),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ hdr->msgh_id, res);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ *pinf = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ *pthread = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- inf = darwin_find_inferior_by_notify (hdr->msgh_local_port);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (res < 0 || inf == NULL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ status->kind = TARGET_WAITKIND_IGNORE;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return minus_one_ptid;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (inf != NULL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (!inf->priv->no_ptrace)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1022,7 +1172,8 @@ darwin_decode_message (mach_msg_header_t *hdr,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* Looks necessary on Leopard and harmless... */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ wait4 (inf->pid, &wstatus, 0, NULL);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return ptid_build (inf->pid, 0, 0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ inferior_ptid = ptid_build (inf->pid, 0, 0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return inferior_ptid;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1204,17 +1355,14 @@ darwin_interrupt (struct target_ops *self, ptid_t t)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ kill (inf->pid, SIGINT);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++/* Deallocate threads port and vector. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ static void
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-darwin_mourn_inferior (struct target_ops *ops)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++darwin_deallocate_threads (struct inferior *inf)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- struct inferior *inf = current_inferior ();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- kern_return_t kret;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- mach_port_t prev;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- int i;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- /* Deallocate threads. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (inf->priv->threads)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ kern_return_t kret;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int k;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ darwin_thread_t *t;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ for (k = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1227,11 +1375,25 @@ darwin_mourn_inferior (struct target_ops *ops)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ VEC_free (darwin_thread_t, inf->priv->threads);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ inf->priv->threads = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++static void
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++darwin_mourn_inferior (struct target_ops *ops)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ struct inferior *inf = current_inferior ();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ kern_return_t kret;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ mach_port_t prev;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int i;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Deallocate threads. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ darwin_deallocate_threads (inf);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Remove notify_port from darwin_port_set. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ kret = mach_port_move_member (gdb_task,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ inf->priv->notify_port, MACH_PORT_NULL);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ MACH_CHECK_ERROR (kret);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Remove task port dead_name notification. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ kret = mach_port_request_notification (gdb_task, inf->priv->task,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ MACH_NOTIFY_DEAD_NAME, 0,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ MACH_PORT_NULL,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1247,19 +1409,14 @@ darwin_mourn_inferior (struct target_ops *ops)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ MACH_CHECK_ERROR (kret);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Destroy notify_port. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ kret = mach_port_destroy (gdb_task, inf->priv->notify_port);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ MACH_CHECK_ERROR (kret);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* Deallocate saved exception ports. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (i = 0; i < inf->priv->exception_info.count; i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- kret = mach_port_deallocate
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- (gdb_task, inf->priv->exception_info.ports[i]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- MACH_CHECK_ERROR (kret);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- inf->priv->exception_info.count = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ darwin_deallocate_exception_ports (inf->priv);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Deallocate task port. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ kret = mach_port_deallocate (gdb_task, inf->priv->task);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ MACH_CHECK_ERROR (kret);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1349,6 +1506,48 @@ darwin_restore_exception_ports (darwin_inferior *inf)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return KERN_SUCCESS;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++/* Deallocate saved exception ports. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++static void
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++darwin_deallocate_exception_ports (darwin_inferior *inf)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int i;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ kern_return_t kret;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (i = 0; i < inf->exception_info.count; i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ kret = mach_port_deallocate (gdb_task, inf->exception_info.ports[i]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ MACH_CHECK_ERROR (kret);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ inf->exception_info.count = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++static void
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++darwin_setup_exceptions (struct inferior *inf)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ kern_return_t kret;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int traps_expected;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ exception_mask_t mask;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ kret = darwin_save_exception_ports (inf->priv);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (kret != KERN_SUCCESS)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ error (_("Unable to save exception ports, task_get_exception_ports"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "returned: %d"),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ kret);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Set exception port. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (enable_mach_exceptions)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ mask = EXC_MASK_ALL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ mask = EXC_MASK_SOFTWARE | EXC_MASK_BREAKPOINT;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ kret = task_set_exception_ports (inf->priv->task, mask, darwin_ex_port,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ EXCEPTION_DEFAULT, THREAD_STATE_NONE);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (kret != KERN_SUCCESS)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ error (_("Unable to set exception ports, task_set_exception_ports"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "returned: %d"),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ kret);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ static void
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ darwin_kill_inferior (struct target_ops *ops)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1385,6 +1584,34 @@ darwin_kill_inferior (struct target_ops *ops)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ static void
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++darwin_setup_request_notification (struct inferior *inf)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ kern_return_t kret;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ mach_port_t prev_not;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ kret = mach_port_request_notification (gdb_task, inf->priv->task,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ MACH_NOTIFY_DEAD_NAME, 0,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ inf->priv->notify_port,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ MACH_MSG_TYPE_MAKE_SEND_ONCE,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ &prev_not);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (kret != KERN_SUCCESS)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ error (_("Termination notification request failed, "
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "mach_port_request_notification\n"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "returned: %d"),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ kret);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (prev_not != MACH_PORT_NULL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* This is unexpected, as there should not be any previously
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ registered notification request. But this is not a fatal
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ issue, so just emit a warning. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ warning (_("\
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++A task termination request was registered before the debugger registered\n\
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++its own. This is unexpected, but should otherwise not have any actual\n\
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++impact on the debugging session."));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++static void
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ darwin_attach_pid (struct inferior *inf)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ kern_return_t kret;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1463,44 +1690,9 @@ darwin_attach_pid (struct inferior *inf)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ "returned: %d"),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ kret);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- kret = mach_port_request_notification (gdb_task, inf->priv->task,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- MACH_NOTIFY_DEAD_NAME, 0,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- inf->priv->notify_port,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- MACH_MSG_TYPE_MAKE_SEND_ONCE,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- &prev_not);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (kret != KERN_SUCCESS)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- error (_("Termination notification request failed, "
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "mach_port_request_notification\n"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "returned: %d"),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- kret);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (prev_not != MACH_PORT_NULL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- /* This is unexpected, as there should not be any previously
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- registered notification request. But this is not a fatal
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- issue, so just emit a warning. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- warning (_("\
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-A task termination request was registered before the debugger registered\n\
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-its own. This is unexpected, but should otherwise not have any actual\n\
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-impact on the debugging session."));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ darwin_setup_request_notification (inf);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- kret = darwin_save_exception_ports (inf->priv);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (kret != KERN_SUCCESS)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- error (_("Unable to save exception ports, task_get_exception_ports"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "returned: %d"),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- kret);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- /* Set exception port. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (enable_mach_exceptions)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- mask = EXC_MASK_ALL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- mask = EXC_MASK_SOFTWARE | EXC_MASK_BREAKPOINT;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- kret = task_set_exception_ports (inf->priv->task, mask, darwin_ex_port,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- EXCEPTION_DEFAULT, THREAD_STATE_NONE);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (kret != KERN_SUCCESS)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- error (_("Unable to set exception ports, task_set_exception_ports"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "returned: %d"),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- kret);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ darwin_setup_exceptions (inf);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (!target_is_pushed (darwin_ops))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ push_target (darwin_ops);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+2.9.3 (Apple Git-75)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span></pre><pre style='margin:0'>
</pre>