priv->pending_messages--;
}
+/* Wrapper around the __pthread_kill syscall. We use this instead of the
+ pthread_kill function to be able to send a signal to any kind of thread,
+ including GCD threads. */
+
+static int
+darwin_pthread_kill (darwin_thread_t *thread, int nsignal)
+{
+ DIAGNOSTIC_PUSH;
+ DIAGNOSTIC_IGNORE_DEPRECATED_DECLARATIONS;
+ int res = syscall (SYS___pthread_kill, thread->gdb_port, nsignal);
+ DIAGNOSTIC_POP;
+ return res;
+}
+
static void
darwin_resume_thread (struct inferior *inf, darwin_thread_t *thread,
int step, int nsignal)
{
- kern_return_t kret;
- int res;
-
inferior_debug
(3, _("darwin_resume_thread: state=%d, thread=0x%x, step=%d nsignal=%d\n"),
thread->msg_state, thread->gdb_port, step, nsignal);
&& thread->event.ex_data[0] == EXC_SOFT_SIGNAL)
{
/* Either deliver a new signal or cancel the signal received. */
- res = PTRACE (PT_THUPDATE, inf->pid,
- (caddr_t) (uintptr_t) thread->gdb_port, nsignal);
+ int res = PTRACE (PT_THUPDATE, inf->pid,
+ (caddr_t) (uintptr_t) thread->gdb_port, nsignal);
if (res < 0)
inferior_debug (1, _("ptrace THUP: res=%d\n"), res);
}
{
/* Note: ptrace is allowed only if the process is stopped.
Directly send the signal to the thread. */
- res = syscall (SYS___pthread_kill, thread->gdb_port, nsignal);
+ int res = darwin_pthread_kill (thread, nsignal);
inferior_debug (4, _("darwin_resume_thread: kill 0x%x %d: %d\n"),
thread->gdb_port, nsignal, res);
thread->signaled = 1;
break;
case DARWIN_STOPPED:
- kret = thread_resume (thread->gdb_port);
+ kern_return_t kret = thread_resume (thread->gdb_port);
MACH_CHECK_ERROR (kret);
thread->msg_state = DARWIN_RUNNING;
#if defined (__clang__) /* clang */
# define DIAGNOSTIC_IGNORE_SELF_MOVE DIAGNOSTIC_IGNORE ("-Wself-move")
+# define DIAGNOSTIC_IGNORE_DEPRECATED_DECLARATIONS \
+ DIAGNOSTIC_IGNORE ("-Wdeprecated-declarations")
# define DIAGNOSTIC_IGNORE_DEPRECATED_REGISTER \
DIAGNOSTIC_IGNORE ("-Wdeprecated-register")
# define DIAGNOSTIC_IGNORE_UNUSED_FUNCTION \
# define DIAGNOSTIC_IGNORE_SELF_MOVE
#endif
+#ifndef DIAGNOSTIC_IGNORE_DEPRECATED_DECLARATIONS
+# define DIAGNOSTIC_IGNORE_DEPRECATED_DECLARATIONS
+#endif
+
#ifndef DIAGNOSTIC_IGNORE_DEPRECATED_REGISTER
# define DIAGNOSTIC_IGNORE_DEPRECATED_REGISTER
#endif