aboutsummaryrefslogtreecommitdiff
path: root/gdb/sol-thread.c
diff options
context:
space:
mode:
authorStu Grossman <grossman@cygnus>1996-05-15 01:09:57 +0000
committerStu Grossman <grossman@cygnus>1996-05-15 01:09:57 +0000
commit9b33e492d6327edb62715d91c9ed22e6d5347ab8 (patch)
tree90bbec038d2718a2124dbb5f0cd797be788a2636 /gdb/sol-thread.c
parentff60fc3aec91ce8505e9e450df932c44149fb7a6 (diff)
downloadgdb-9b33e492d6327edb62715d91c9ed22e6d5347ab8.zip
gdb-9b33e492d6327edb62715d91c9ed22e6d5347ab8.tar.gz
gdb-9b33e492d6327edb62715d91c9ed22e6d5347ab8.tar.bz2
* 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.
Diffstat (limited to 'gdb/sol-thread.c')
-rw-r--r--gdb/sol-thread.c35
1 files changed, 16 insertions, 19 deletions
diff --git a/gdb/sol-thread.c b/gdb/sol-thread.c
index 96a5d78..d107e22 100644
--- a/gdb/sol-thread.c
+++ b/gdb/sol-thread.c
@@ -504,7 +504,7 @@ sol_thread_fetch_registers (regno)
thread_t thread;
td_thrhandle_t thandle;
td_err_e val;
- prgregset_t regset;
+ prgregset_t gregset;
prfpregset_t fpregset;
#if 0
int xregsize;
@@ -525,33 +525,30 @@ sol_thread_fetch_registers (regno)
/* 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);