* ada-lang.c (user_select_syms): Use SYMBOL_SYMTAB.
[deliverable/binutils-gdb.git] / gdb / sol-thread.c
index 585a77f3b6850539c1bde1f035bd23c1cde03448..b627741f8c1398e7882c0032cd08bc8a15f35e34 100644 (file)
@@ -196,7 +196,8 @@ td_err_string (td_err_e errcode)
     if (td_err_table[i].num == errcode)
       return td_err_table[i].str;
 
-  sprintf (buf, "Unknown libthread_db error code: %d", errcode);
+  xsnprintf (buf, sizeof (buf), "Unknown libthread_db error code: %d",
+            errcode);
 
   return buf;
 }
@@ -227,7 +228,8 @@ td_state_string (td_thr_state_e statecode)
     if (td_thr_state_table[i].num == statecode)
       return td_thr_state_table[i].str;
 
-  sprintf (buf, "Unknown libthread_db state code: %d", statecode);
+  xsnprintf (buf, sizeof (buf), "Unknown libthread_db state code: %d",
+            statecode);
 
   return buf;
 }
@@ -443,11 +445,6 @@ sol_thread_fetch_registers (struct target_ops *ops,
   gdb_fpregset_t *fpregset_p = &fpregset;
   struct target_ops *beneath = find_target_beneath (ops);
 
-#if 0
-  int xregsize;
-  caddr_t xregset;
-#endif
-
   if (!is_thread (inferior_ptid))
     {
       /* It's an LWP; pass the request on to the layer beneath.  */
@@ -488,23 +485,6 @@ sol_thread_fetch_registers (struct target_ops *ops,
 
   supply_gregset (regcache, (const gdb_gregset_t *) gregset_p);
   supply_fpregset (regcache, (const gdb_fpregset_t *) fpregset_p);
-
-#if 0
-  /* FIXME: libthread_db doesn't seem to handle this right.  */
-  val = td_thr_getxregsize (&thandle, &xregsize);
-  if (val != TD_OK && val != TD_NOXREGS)
-    error (_("sol_thread_fetch_registers: td_thr_getxregsize %s"),
-          td_err_string (val));
-
-  if (val == TD_OK)
-    {
-      xregset = alloca (xregsize);
-      val = td_thr_getxregs (&thandle, xregset);
-      if (val != TD_OK)
-       error (_("sol_thread_fetch_registers: td_thr_getxregs %s"),
-              td_err_string (val));
-    }
-#endif
 }
 
 static void
@@ -516,10 +496,6 @@ sol_thread_store_registers (struct target_ops *ops,
   td_err_e val;
   prgregset_t gregset;
   prfpregset_t fpregset;
-#if 0
-  int xregsize;
-  caddr_t xregset;
-#endif
 
   if (!is_thread (inferior_ptid))
     {
@@ -557,23 +533,6 @@ sol_thread_store_registers (struct target_ops *ops,
 
       /* Restore new register value.  */
       regcache_raw_supply (regcache, regnum, old_value);
-
-#if 0
-      /* FIXME: libthread_db doesn't seem to handle this right.  */
-      val = td_thr_getxregsize (&thandle, &xregsize);
-      if (val != TD_OK && val != TD_NOXREGS)
-       error (_("sol_thread_store_registers: td_thr_getxregsize %s"),
-              td_err_string (val));
-
-      if (val == TD_OK)
-       {
-         xregset = alloca (xregsize);
-         val = td_thr_getxregs (&thandle, xregset);
-         if (val != TD_OK)
-           error (_("sol_thread_store_registers: td_thr_getxregs %s"),
-                  td_err_string (val));
-       }
-#endif
     }
 
   fill_gregset (regcache, (gdb_gregset_t *) &gregset, regnum);
@@ -587,17 +546,6 @@ sol_thread_store_registers (struct target_ops *ops,
   if (val != TD_OK)
     error (_("sol_thread_store_registers: td_thr_setfpregs %s"),
           td_err_string (val));
-
-#if 0
-  /* FIXME: libthread_db doesn't seem to handle this right.  */
-  val = td_thr_getxregsize (&thandle, &xregsize);
-  if (val != TD_OK && val != TD_NOXREGS)
-    error (_("sol_thread_store_registers: td_thr_getxregsize %s"),
-          td_err_string (val));
-
-  /* ??? Should probably do something about writing the xregs here,
-     but what are they?  */
-#endif
 }
 
 /* Perform partial transfers on OBJECT.  See target_read_partial and
@@ -915,7 +863,7 @@ ps_lgetregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, prgregset_t gregset)
   old_chain = save_inferior_ptid ();
 
   inferior_ptid = BUILD_LWP (lwpid, PIDGET (inferior_ptid));
-  regcache = get_thread_arch_regcache (inferior_ptid, target_gdbarch);
+  regcache = get_thread_arch_regcache (inferior_ptid, target_gdbarch ());
 
   target_fetch_registers (regcache, -1);
   fill_gregset (regcache, (gdb_gregset_t *) gregset, -1);
@@ -937,7 +885,7 @@ ps_lsetregs (gdb_ps_prochandle_t ph, lwpid_t lwpid,
   old_chain = save_inferior_ptid ();
 
   inferior_ptid = BUILD_LWP (lwpid, PIDGET (inferior_ptid));
-  regcache = get_thread_arch_regcache (inferior_ptid, target_gdbarch);
+  regcache = get_thread_arch_regcache (inferior_ptid, target_gdbarch ());
 
   supply_gregset (regcache, (const gdb_gregset_t *) gregset);
   target_store_registers (regcache, -1);
@@ -971,7 +919,7 @@ ps_lgetfpregs (gdb_ps_prochandle_t ph, lwpid_t lwpid,
   old_chain = save_inferior_ptid ();
 
   inferior_ptid = BUILD_LWP (lwpid, PIDGET (inferior_ptid));
-  regcache = get_thread_arch_regcache (inferior_ptid, target_gdbarch);
+  regcache = get_thread_arch_regcache (inferior_ptid, target_gdbarch ());
 
   target_fetch_registers (regcache, -1);
   fill_fpregset (regcache, (gdb_fpregset_t *) fpregset, -1);
@@ -993,7 +941,7 @@ ps_lsetfpregs (gdb_ps_prochandle_t ph, lwpid_t lwpid,
   old_chain = save_inferior_ptid ();
 
   inferior_ptid = BUILD_LWP (lwpid, PIDGET (inferior_ptid));
-  regcache = get_thread_arch_regcache (inferior_ptid, target_gdbarch);
+  regcache = get_thread_arch_regcache (inferior_ptid, target_gdbarch ());
 
   supply_fpregset (regcache, (const gdb_fpregset_t *) fpregset);
   target_store_registers (regcache, -1);
@@ -1069,17 +1017,18 @@ solaris_pid_to_str (struct target_ops *ops, ptid_t ptid)
       lwp = thread_to_lwp (ptid, -2);
 
       if (PIDGET (lwp) == -1)
-       sprintf (buf, "Thread %ld (defunct)", GET_THREAD (ptid));
+       xsnprintf (buf, sizeof (buf), "Thread %ld (defunct)",
+                  GET_THREAD (ptid));
       else if (PIDGET (lwp) != -2)
-       sprintf (buf, "Thread %ld (LWP %ld)",
+       xsnprintf (buf, sizeof (buf), "Thread %ld (LWP %ld)",
                 GET_THREAD (ptid), GET_LWP (lwp));
       else
-       sprintf (buf, "Thread %ld        ", GET_THREAD (ptid));
+       xsnprintf (buf, sizeof (buf), "Thread %ld        ", GET_THREAD (ptid));
     }
   else if (GET_LWP (ptid) != 0)
-    sprintf (buf, "LWP    %ld        ", GET_LWP (ptid));
+    xsnprintf (buf, sizeof (buf), "LWP    %ld        ", GET_LWP (ptid));
   else
-    sprintf (buf, "process %d    ", PIDGET (ptid));
+    xsnprintf (buf, sizeof (buf), "process %d    ", PIDGET (ptid));
 
   return buf;
 }
@@ -1173,7 +1122,7 @@ info_cb (const td_thrhandle_t *th, void *s)
                             SYMBOL_PRINT_NAME (msym));
          else
            printf_filtered ("   startfunc: %s\n",
-                            paddress (target_gdbarch, ti.ti_startfunc));
+                            paddress (target_gdbarch (), ti.ti_startfunc));
        }
 
       /* If thread is asleep, print function that went to sleep.  */
@@ -1186,7 +1135,7 @@ info_cb (const td_thrhandle_t *th, void *s)
                             SYMBOL_PRINT_NAME (msym));
          else
            printf_filtered (" - Sleep func: %s\n",
-                            paddress (target_gdbarch, ti.ti_startfunc));
+                            paddress (target_gdbarch (), ti.ti_startfunc));
        }
 
       /* Wrap up line, if necessary.  */
This page took 0.026287 seconds and 4 git commands to generate.