View | Details | Raw Unified | Return to bug 201207 | Differences between
and this patch

Collapse All | Expand All

(-)devel/gdb/files/fbsd-threads.c (-9 / +27 lines)
Lines 320-335 Link Here
320
  lwp = get_current_lwp (proc_handle.pid);
320
  lwp = get_current_lwp (proc_handle.pid);
321
  tmp = BUILD_LWP (lwp, proc_handle.pid);
321
  tmp = BUILD_LWP (lwp, proc_handle.pid);
322
  ptid = thread_from_lwp (tmp, &th, &ti);
322
  ptid = thread_from_lwp (tmp, &th, &ti);
323
  if (in_thread_list (inferior_ptid) )
323
  if (in_thread_list (inferior_ptid))
324
    {
324
    {
325
      struct thread_info * ti_inf = inferior_thread();
325
      struct private_thread_info *private;
326
      ti_inf->ptid = ptid;
326
      struct thread_info *tp;
327
      td_err_e err;
328
329
      thread_change_ptid (inferior_ptid, ptid);
330
331
      /* Add thread with info */
332
      private = xcalloc(1, sizeof(struct private_thread_info));
333
      gdb_assert(private != NULL);
334
      // Thread name is assigned when printed
335
336
      tp = find_thread_ptid (ptid);
337
      gdb_assert(tp->priv == NULL);
338
      tp->priv = private;
339
      tp->private_dtor = free_private_thread_info;
340
      if (target_has_execution)
341
	{
342
	  /* Enable thread event reporting for this thread. */
343
	  err = td_thr_event_enable_p (&th, 1);
344
	  if (err != TD_OK)
345
	    error ("Cannot enable thread event reporting for %s: %s",
346
		   target_pid_to_str (ptid), thread_db_err_str (err));
347
	}
327
    }
348
    }
328
  if (!in_thread_list (ptid))
349
  else if (!in_thread_list (ptid))
329
    {
350
    {
330
      attach_thread (ptid, &th, &ti, 1);
351
      attach_thread (ptid, &th, &ti, 1);
331
    }
352
    }
332
  inferior_ptid = ptid;
333
}
353
}
334
354
335
static CORE_ADDR
355
static CORE_ADDR
Lines 443-450 Link Here
443
    enable_thread_event_reporting ();
463
    enable_thread_event_reporting ();
444
  else
464
  else
445
    init_thread_list ();
465
    init_thread_list ();
466
  get_current_thread ();
446
  fbsd_thread_update_thread_list (NULL);
467
  fbsd_thread_update_thread_list (NULL);
447
  get_current_thread ();
448
}
468
}
449
469
450
static void
470
static void
Lines 669-681 Link Here
669
  if (!in_thread_list (ptid))
689
  if (!in_thread_list (ptid))
670
  {
690
  {
671
    /* Add thread with info */
691
    /* Add thread with info */
672
    private = xmalloc(sizeof(struct private_thread_info));
692
    private = xcalloc(1, sizeof(struct private_thread_info));
673
    gdb_assert(private != NULL);
693
    gdb_assert(private != NULL);
674
    // Thread name is assigned when printed
694
    // Thread name is assigned when printed
675
    memset(private, 0, sizeof(struct private_thread_info));
676
695
677
    tp = add_thread_with_info(ptid, private);
696
    tp = add_thread_with_info(ptid, private);
678
    tp->priv = private;
679
    tp->private_dtor = free_private_thread_info;
697
    tp->private_dtor = free_private_thread_info;
680
  }
698
  }
681
699

Return to bug 201207