+Tue May 14 18:05:16 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * procfs.c (procfs_thread_alive procfs_stop): Make static.
+ * (procfs_pid_to_str): New routine to print out thread id's in an
+ intelligible manner.
+ * sol-thread.c (sol_thread_fetch_registers): Re-order manner in
+ which supply_register is called to fix bug with writing writing
+ individual regs.
+ * config/sparc/tm-sun4sol2.h: Define default for
+ target_pid_to_str in case host lacks libthread_db.
+
Mon May 13 23:53:30 1996 Stu Grossman (grossman@critters.cygnus.com)
* Makefile.in config.in configure configure.in
/* Why is this necessary? Shouldn't dead threads just be removed from the
thread database? */
-int
+static int
procfs_thread_alive (pid)
int pid;
{
XXX - This may not be correct for all systems. Some may want to use
killpg() instead of kill (-pgrp). */
-void
+static void
procfs_stop ()
{
extern pid_t inferior_process_group;
kill (-inferior_process_group, SIGINT);
}
+\f
+/* Convert a pid to printable form. */
+#ifdef TIDGET
+char *
+procfs_pid_to_str (pid)
+ int pid;
+{
+ static char buf[100];
+
+ sprintf (buf, "Kernel thread %d", TIDGET (pid));
+
+ return buf;
+}
+#endif /* TIDGET */
\f
struct target_ops procfs_ops = {
"procfs", /* to_shortname */
thread_t thread;
td_thrhandle_t thandle;
td_err_e val;
- prgregset_t regset;
+ prgregset_t gregset;
prfpregset_t fpregset;
#if 0
int xregsize;
/* Get the integer regs */
- val = td_thr_getgregs (&thandle, regset);
- if (val == TD_OK)
- supply_gregset (regset);
- else if (val == TD_PARTIALREG)
- {
- /* For the sparc, only i0->i7, l0->l7, pc and sp are saved by a thread
- context switch. */
-
- supply_gregset (regset); /* This is not entirely correct, as it sets
- the valid bits for the o, g, ps, y, npc,
- wim and tbr. That should be harmless
- though, as the context switch routine
- doesn't need to save them. */
- }
- else
+ val = td_thr_getgregs (&thandle, gregset);
+ if (val != TD_OK
+ && val != TD_PARTIALREG)
error ("sol_thread_fetch_registers: td_thr_getgregs %s",
td_err_string (val));
+ /* For the sparc, TD_PARTIALREG means that only i0->i7, l0->l7, pc and sp
+ are saved (by a thread context switch). */
+
/* And, now the fp regs */
val = td_thr_getfpregs (&thandle, &fpregset);
- if (val == TD_OK)
- supply_fpregset (fpregset);
- else if (val != TD_NOFPREGS)
+ if (val != TD_OK
+ && val != TD_NOFPREGS)
error ("sol_thread_fetch_registers: td_thr_getfpregs %s",
td_err_string (val));
+/* Note that we must call supply_{g fp}regset *after* calling the td routines
+ because the td routines call ps_lget* which affect the values stored in the
+ registers array. */
+
+ supply_gregset (gregset);
+ supply_fpregset (fpregset);
+
#if 0
/* thread_db doesn't seem to handle this right */
val = td_thr_getxregsize (&thandle, &xregsize);