fatal ("unexpected thread_db->td_ta_event_getmsg_p == NULL");
if (debug_threads)
- fprintf (stderr, "Thread creation event.\n");
+ debug_printf ("Thread creation event.\n");
/* FIXME: This assumes we don't get another event.
In the LinuxThreads implementation, this is safe,
lwpid, thread_db_err_str (err));
if (debug_threads)
- fprintf (stderr, "Found thread %ld (LWP %d)\n",
- ti.ti_tid, ti.ti_lid);
+ debug_printf ("Found thread %ld (LWP %d)\n",
+ ti.ti_tid, ti.ti_lid);
if (lwpid != ti.ti_lid)
{
struct lwp_info *lwp;
if (debug_threads)
- fprintf (stderr, "Attaching to thread %ld (LWP %d)\n",
- ti_p->ti_tid, ti_p->ti_lid);
+ debug_printf ("Attaching to thread %ld (LWP %d)\n",
+ ti_p->ti_tid, ti_p->ti_lid);
linux_attach_lwp (ti_p->ti_lid);
lwp = find_lwp_pid (pid_to_ptid (ti_p->ti_lid));
if (lwp == NULL)
TD_THR_LOWEST_PRIORITY,
TD_SIGNO_MASK, TD_THR_ANY_USER_FLAGS);
if (debug_threads)
- fprintf (stderr, "Found %d threads in iteration %d.\n",
- new_thread_count, iteration);
+ debug_printf ("Found %d threads in iteration %d.\n",
+ new_thread_count, iteration);
if (new_thread_count != 0)
{
if (err != TD_OK)
{
if (debug_threads)
- fprintf (stderr, "td_ta_new(): %s\n", thread_db_err_str (err));
+ debug_printf ("td_ta_new(): %s\n", thread_db_err_str (err));
free (tdb);
proc->private->thread_db = NULL;
return 0;
if ((a) == NULL) \
{ \
if (debug_threads) \
- fprintf (stderr, "dlsym: %s\n", dlerror ()); \
+ debug_printf ("dlsym: %s\n", dlerror ()); \
if (required) \
{ \
free (tdb); \
if (err != TD_OK)
{
if (debug_threads)
- fprintf (stderr, "td_ta_new(): %s\n", thread_db_err_str (err));
+ debug_printf ("td_ta_new(): %s\n", thread_db_err_str (err));
free (tdb);
proc->private->thread_db = NULL;
return 0;
void *handle;
if (debug_threads)
- fprintf (stderr, "Trying host libthread_db library: %s.\n",
- library);
+ debug_printf ("Trying host libthread_db library: %s.\n",
+ library);
handle = dlopen (library, RTLD_NOW);
if (handle == NULL)
{
if (debug_threads)
- fprintf (stderr, "dlopen failed: %s.\n", dlerror ());
+ debug_printf ("dlopen failed: %s.\n", dlerror ());
return 0;
}
free_char_ptr_vec (dir_vec);
if (debug_threads)
- fprintf (stderr, "thread_db_load_search returning %d\n", rc);
+ debug_printf ("thread_db_load_search returning %d\n", rc);
return rc;
}