+2018-08-02 Tom Tromey <tom@tromey.com>
+
+ * darwin-nat.c (find_inferior_task_it, darwin_find_thread)
+ (darwin_suspend_inferior, darwin_resume_inferior)
+ (darwin_decode_notify_message, darwin_resume_inferior_threads)
+ (darwin_check_new_threads): Check result of get_darwin_inferior.
+
2018-07-31 Joel Brobecker <brobecker@adacore.com>
GDB 8.1.1 released.
darwin_inferior *darwin_inf = get_darwin_inferior (inf);
std::vector<darwin_thread_t *> new_thread_vec;
+ if (darwin_inf == nullptr)
+ return;
+
/* Get list of threads. */
kret = task_threads (darwin_inf->task, &thread_list, &new_nbr);
MACH_CHECK_ERROR (kret);
{
darwin_inferior *priv = get_darwin_inferior (inf);
- return priv->task == *(task_t *)port_ptr;
+ return priv != nullptr && priv->task == *(task_t *)port_ptr;
}
static int
{
darwin_inferior *priv = get_darwin_inferior (inf);
- for (darwin_thread_t *t : priv->threads)
- {
- if (t->gdb_port == thread)
- return t;
- }
+ if (priv != nullptr)
+ for (darwin_thread_t *t : priv->threads)
+ {
+ if (t->gdb_port == thread)
+ return t;
+ }
return NULL;
}
{
darwin_inferior *priv = get_darwin_inferior (inf);
- if (!priv->suspended)
+ if (priv != nullptr && !priv->suspended)
{
kern_return_t kret;
{
darwin_inferior *priv = get_darwin_inferior (inf);
- if (priv->suspended)
+ if (priv != nullptr && priv->suspended)
{
kern_return_t kret;
inf = darwin_find_inferior_by_task (task_port);
*pinf = inf;
- darwin_inferior *priv = get_darwin_inferior (inf);
-
/* Check message destination. */
- if (inf != NULL && hdr->msgh_local_port != priv->notify_port)
- return -4;
+ if (inf != NULL)
+ {
+ darwin_inferior *priv = get_darwin_inferior (inf);
+ if (hdr->msgh_local_port != priv->notify_port)
+ return -4;
+ }
return 0;
}
{
darwin_inferior *priv = get_darwin_inferior (inf);
- for (darwin_thread_t *thread : priv->threads)
- darwin_resume_thread (inf, thread, step, nsignal);
+ if (priv != nullptr)
+ for (darwin_thread_t *thread : priv->threads)
+ darwin_resume_thread (inf, thread, step, nsignal);
}
struct resume_inferior_threads_param