char *path, *cp;
int result;
const char *obj_name = objfile_name (obj);
+ int alloc_len;
if (obj_name[0] != '/')
{
return 0;
}
- path = xmalloc (strlen (obj_name) + (subdir ? strlen (subdir) + 1 : 0)
- + 1 + strlen (LIBTHREAD_DB_SO) + 1);
+ alloc_len = (strlen (obj_name)
+ + (subdir ? strlen (subdir) + 1 : 0)
+ + 1 + strlen (LIBTHREAD_DB_SO) + 1);
+ path = (char *) xmalloc (alloc_len);
cleanup = make_cleanup (xfree, path);
strcpy (path, obj_name);
if (!auto_load_thread_db)
return 0;
- path = xmalloc (dir_len + 1 + strlen (LIBTHREAD_DB_SO) + 1);
+ path = (char *) xmalloc (dir_len + 1 + strlen (LIBTHREAD_DB_SO) + 1);
cleanup = make_cleanup (xfree, path);
memcpy (path, dir, dir_len);
if (this_dir[pdir_len] == '/')
{
- subdir = xmalloc (strlen (this_dir));
+ subdir = (char *) xmalloc (strlen (this_dir));
make_cleanup (xfree, subdir);
strcpy (subdir, this_dir + pdir_len + 1);
}
td_err_e err;
ptid_t ptid;
struct thread_info *tp;
- struct callback_data *cb_data = data;
+ struct callback_data *cb_data = (struct callback_data *) data;
struct thread_db_info *info = cb_data->info;
err = info->td_thr_get_info_p (th_p, &ti);
if (libthread_db_debug)
fprintf_unfiltered (gdb_stdlog,
"thread_db: skipping exited and "
- "joined thread (0x%lx)\n", ti.ti_tid);
+ "joined thread (0x%lx)\n",
+ (unsigned long) ti.ti_tid);
return 0;
}
tid = thread_info->priv->tid;
snprintf (buf, sizeof (buf), "Thread 0x%lx (LWP %ld)",
- tid, ptid_get_lwp (ptid));
+ (unsigned long) tid, ptid_get_lwp (ptid));
return buf;
}
ui_out_table_header (uiout, pids_len, ui_left, "PIDs", "Pids");
ui_out_table_body (uiout);
- pids = xmalloc (max_pids_len + 1);
+ pids = (char *) xmalloc (max_pids_len + 1);
make_cleanup (xfree, pids);
/* Note I is incremented inside the cycle, not at its end. */