/* Solaris threads debugging interface.
- Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
- Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+ 2005 Free Software Foundation, Inc.
This file is part of GDB.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA. */
/* This module implements a sort of half target that sits between the
machine-independent parts of GDB and the /proc interface (procfs.c)
#include "gdbcmd.h"
#include "gdbcore.h"
#include "regcache.h"
+#include "solib.h"
#include "symfile.h"
#include "gdb_string.h"
if (val == TD_NOTHR)
return pid_to_ptid (-1); /* Thread must have terminated. */
else if (val != TD_OK)
- error ("thread_to_lwp: td_ta_map_id2thr %s", td_err_string (val));
+ error (_("thread_to_lwp: td_ta_map_id2thr %s"), td_err_string (val));
val = p_td_thr_get_info (&th, &ti);
if (val == TD_NOTHR)
return pid_to_ptid (-1); /* Thread must have terminated. */
else if (val != TD_OK)
- error ("thread_to_lwp: td_thr_get_info: %s", td_err_string (val));
+ error (_("thread_to_lwp: td_thr_get_info: %s"), td_err_string (val));
if (ti.ti_state != TD_THR_ACTIVE)
{
if (default_lwp != -1)
return pid_to_ptid (default_lwp);
- error ("thread_to_lwp: thread state not active: %s",
+ error (_("thread_to_lwp: thread state not active: %s"),
td_state_string (ti.ti_state));
}
if (val == TD_NOTHR)
return pid_to_ptid (-1); /* Thread must have terminated. */
else if (val != TD_OK)
- error ("lwp_to_thread: td_ta_map_lwp2thr: %s.", td_err_string (val));
+ error (_("lwp_to_thread: td_ta_map_lwp2thr: %s."), td_err_string (val));
val = p_td_thr_validate (&th);
if (val == TD_NOTHR)
return lwp; /* Unknown to libthread; just return LPW, */
else if (val != TD_OK)
- error ("lwp_to_thread: td_thr_validate: %s.", td_err_string (val));
+ error (_("lwp_to_thread: td_thr_validate: %s."), td_err_string (val));
val = p_td_thr_get_info (&th, &ti);
if (val == TD_NOTHR)
return pid_to_ptid (-1); /* Thread must have terminated. */
else if (val != TD_OK)
- error ("lwp_to_thread: td_thr_get_info: %s.", td_err_string (val));
+ error (_("lwp_to_thread: td_thr_get_info: %s."), td_err_string (val));
return BUILD_THREAD (ti.ti_tid, PIDGET (lwp));
}
procfs_ops.to_attach (args, from_tty);
/* Must get symbols from shared libraries before libthread_db can run! */
- SOLIB_ADD ((char *) 0, from_tty, (struct target_ops *) 0, auto_solib_add);
+ solib_add (NULL, from_tty, (struct target_ops *) 0, auto_solib_add);
if (sol_thread_active)
{
ptid = thread_to_lwp (ptid, -2);
if (PIDGET (ptid) == -2) /* Inactive thread. */
- error ("This version of Solaris can't start inactive threads.");
+ error (_("This version of Solaris can't start inactive threads."));
if (info_verbose && PIDGET (ptid) == -1)
- warning ("Specified thread %ld seems to have terminated",
+ warning (_("Specified thread %ld seems to have terminated"),
GET_THREAD (save_ptid));
}
ptid = thread_to_lwp (ptid, -2);
if (PIDGET (ptid) == -2) /* Inactive thread. */
- error ("This version of Solaris can't start inactive threads.");
+ error (_("This version of Solaris can't start inactive threads."));
if (info_verbose && PIDGET (ptid) == -1)
- warning ("Specified thread %ld seems to have terminated",
+ warning (_("Specified thread %ld seems to have terminated"),
GET_THREAD (save_ptid));
}
/* Solaris thread: convert INFERIOR_PTID into a td_thrhandle_t. */
thread = GET_THREAD (inferior_ptid);
if (thread == 0)
- error ("sol_thread_fetch_registers: thread == 0");
+ error (_("sol_thread_fetch_registers: thread == 0"));
val = p_td_ta_map_id2thr (main_ta, thread, &thandle);
if (val != TD_OK)
- error ("sol_thread_fetch_registers: td_ta_map_id2thr: %s",
+ error (_("sol_thread_fetch_registers: td_ta_map_id2thr: %s"),
td_err_string (val));
/* Get the general-purpose registers. */
val = p_td_thr_getgregs (&thandle, gregset);
if (val != TD_OK && val != TD_PARTIALREG)
- error ("sol_thread_fetch_registers: td_thr_getgregs %s",
+ error (_("sol_thread_fetch_registers: td_thr_getgregs %s"),
td_err_string (val));
/* For SPARC, TD_PARTIALREG means that only %i0...%i7, %l0..%l7, %pc
val = p_td_thr_getfpregs (&thandle, &fpregset);
if (val != TD_OK && val != TD_NOFPREGS)
- error ("sol_thread_fetch_registers: td_thr_getfpregs %s",
+ error (_("sol_thread_fetch_registers: td_thr_getfpregs %s"),
td_err_string (val));
/* Note that we must call supply_gregset and supply_fpregset *after*
/* 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",
+ 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",
+ error (_("sol_thread_fetch_registers: td_thr_getxregs %s"),
td_err_string (val));
}
#endif
val = p_td_ta_map_id2thr (main_ta, thread, &thandle);
if (val != TD_OK)
- error ("sol_thread_store_registers: td_ta_map_id2thr %s",
+ error (_("sol_thread_store_registers: td_ta_map_id2thr %s"),
td_err_string (val));
if (regnum != -1)
char old_value[MAX_REGISTER_SIZE];
/* Save new register value. */
- regcache_collect (regnum, old_value);
+ regcache_raw_collect (current_regcache, regnum, old_value);
val = p_td_thr_getgregs (&thandle, gregset);
if (val != TD_OK)
- error ("sol_thread_store_registers: td_thr_getgregs %s",
+ error (_("sol_thread_store_registers: td_thr_getgregs %s"),
td_err_string (val));
val = p_td_thr_getfpregs (&thandle, &fpregset);
if (val != TD_OK)
- error ("sol_thread_store_registers: td_thr_getfpregs %s",
+ error (_("sol_thread_store_registers: td_thr_getfpregs %s"),
td_err_string (val));
/* Restore new register value. */
- supply_register (regnum, old_value);
+ regcache_raw_supply (current_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",
+ 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",
+ error (_("sol_thread_store_registers: td_thr_getxregs %s"),
td_err_string (val));
}
#endif
val = p_td_thr_setgregs (&thandle, gregset);
if (val != TD_OK)
- error ("sol_thread_store_registers: td_thr_setgregs %s",
+ error (_("sol_thread_store_registers: td_thr_setgregs %s"),
td_err_string (val));
val = p_td_thr_setfpregs (&thandle, &fpregset);
if (val != TD_OK)
- error ("sol_thread_store_registers: td_thr_setfpregs %s",
+ 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",
+ error (_("sol_thread_store_registers: td_thr_getxregsize %s"),
td_err_string (val));
/* ??? Should probably do something about writing the xregs here,
Returns the number of bytes transferred. */
static int
-sol_thread_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int dowrite,
- struct mem_attrib *attrib,
+sol_thread_xfer_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len,
+ int dowrite, struct mem_attrib *attrib,
struct target_ops *target)
{
int retval;
}
if (target_has_execution)
- retval = procfs_ops.to_xfer_memory (memaddr, myaddr, len,
- dowrite, attrib, target);
+ retval = procfs_ops.deprecated_xfer_memory (memaddr, myaddr, len,
+ dowrite, attrib, target);
else
- retval = orig_core_ops.to_xfer_memory (memaddr, myaddr, len,
- dowrite, attrib, target);
+ retval = orig_core_ops.deprecated_xfer_memory (memaddr, myaddr, len,
+ dowrite, attrib, target);
do_cleanups (old_chain);
static LONGEST
sol_thread_xfer_partial (struct target_ops *ops, enum target_object object,
- const char *annex, void *readbuf,
- const void *writebuf, ULONGEST offset, LONGEST len)
+ const char *annex, gdb_byte *readbuf,
+ const gdb_byte *writebuf,
+ ULONGEST offset, LONGEST len)
{
int retval;
struct cleanup *old_chain;
/* Fork an inferior process, and start debugging it with /proc. */
static void
-sol_thread_create_inferior (char *exec_file, char *allargs, char **env)
+sol_thread_create_inferior (char *exec_file, char *allargs, char **env,
+ int from_tty)
{
- procfs_ops.to_create_inferior (exec_file, allargs, env);
+ procfs_ops.to_create_inferior (exec_file, allargs, env, from_tty);
if (sol_thread_active && !ptid_equal (inferior_ptid, null_ptid))
{
val = p_td_init ();
if (val != TD_OK)
{
- warning ("sol_thread_new_objfile: td_init: %s", td_err_string (val));
+ warning (_("sol_thread_new_objfile: td_init: %s"), td_err_string (val));
goto quit;
}
goto quit;
else if (val != TD_OK)
{
- warning ("sol_thread_new_objfile: td_ta_new: %s", td_err_string (val));
+ warning (_("sol_thread_new_objfile: td_ta_new: %s"), td_err_string (val));
goto quit;
}
/* FIXME: passing 0 as attrib argument. */
if (target_has_execution)
- cc = procfs_ops.to_xfer_memory (addr, buf, size,
- dowrite, 0, &procfs_ops);
+ cc = procfs_ops.deprecated_xfer_memory (addr, buf, size,
+ dowrite, 0, &procfs_ops);
else
- cc = orig_core_ops.to_xfer_memory (addr, buf, size,
- dowrite, 0, &core_ops);
+ cc = orig_core_ops.deprecated_xfer_memory (addr, buf, size,
+ dowrite, 0, &core_ops);
if (cc < 0)
{
else if (cc == 0)
{
if (dowrite == 0)
- warning ("rw_common (): unable to read at addr 0x%lx",
+ warning (_("rw_common (): unable to read at addr 0x%lx"),
(long) addr);
else
- warning ("rw_common (): unable to write at addr 0x%lx",
+ warning (_("rw_common (): unable to write at addr 0x%lx"),
(long) addr);
do_cleanups (old_chain);
printf_filtered ("\n"); /* don't you hate counting newlines? */
}
else
- warning ("info sol-thread: failed to get info for thread.");
+ warning (_("info sol-thread: failed to get info for thread."));
return 0;
}
}
static int
-ignore (CORE_ADDR addr, char *contents)
+ignore (struct bp_target_info *bp_tgt)
{
return 0;
}
sol_thread_ops.to_fetch_registers = sol_thread_fetch_registers;
sol_thread_ops.to_store_registers = sol_thread_store_registers;
sol_thread_ops.to_prepare_to_store = sol_thread_prepare_to_store;
- sol_thread_ops.to_xfer_memory = sol_thread_xfer_memory;
+ sol_thread_ops.deprecated_xfer_memory = sol_thread_xfer_memory;
sol_thread_ops.to_xfer_partial = sol_thread_xfer_partial;
sol_thread_ops.to_files_info = sol_thread_files_info;
sol_thread_ops.to_insert_breakpoint = memory_insert_breakpoint;
sol_core_ops.to_attach = sol_thread_attach;
sol_core_ops.to_detach = sol_core_detach;
sol_core_ops.to_fetch_registers = sol_thread_fetch_registers;
- sol_core_ops.to_xfer_memory = sol_thread_xfer_memory;
+ sol_core_ops.deprecated_xfer_memory = sol_thread_xfer_memory;
sol_core_ops.to_xfer_partial = sol_thread_xfer_partial;
sol_core_ops.to_files_info = sol_core_files_info;
sol_core_ops.to_insert_breakpoint = ignore;
procfs_suppress_run = 1;
add_cmd ("sol-threads", class_maintenance, info_solthreads,
- "Show info on Solaris user threads.\n", &maintenanceinfolist);
+ _("Show info on Solaris user threads."), &maintenanceinfolist);
memcpy (&orig_core_ops, &core_ops, sizeof (struct target_ops));
memcpy (&core_ops, &sol_core_ops, sizeof (struct target_ops));