Print this page
27908 ::gcore breaks sparc build


 159 ps_lsetfpregs(struct ps_prochandle *P, lwpid_t lwpid, const prfpregset_t *regs)
 160 {
 161         if (P->state != PS_STOP)
 162                 return (PS_ERR);
 163 
 164         if (Plwp_setfpregs(P, lwpid, regs) == 0)
 165                 return (PS_OK);
 166 
 167         return (PS_BADLID);
 168 }
 169 
 170 #if defined(sparc) || defined(__sparc)
 171 
 172 ps_err_e
 173 ps_lgetxregsize(struct ps_prochandle *P, lwpid_t lwpid, int *xrsize)
 174 {
 175         char fname[PATH_MAX];
 176         struct stat statb;
 177 
 178         if (P->state == PS_DEAD) {
 179                 lwp_info_t *lwp = list_next(&P->core->core_lwp_head);

 180                 uint_t i;
 181 
 182                 for (i = 0; i < P->core->core_nlwp; i++, lwp = list_next(lwp)) {
 183                         if (lwp->lwp_id == lwpid) {
 184                                 if (lwp->lwp_xregs != NULL)
 185                                         *xrsize = sizeof (prxregset_t);
 186                                 else
 187                                         *xrsize = 0;
 188                                 return (PS_OK);
 189                         }
 190                 }
 191 
 192                 return (PS_BADLID);
 193         }
 194 
 195         (void) snprintf(fname, sizeof (fname), "%s/%d/lwp/%d/xregs",
 196             procfs_path, (int)P->status.pr_pid, (int)lwpid);
 197 
 198         if (stat(fname, &statb) != 0)
 199                 return (PS_BADLID);
 200 
 201         *xrsize = (int)statb.st_size;
 202         return (PS_OK);




 159 ps_lsetfpregs(struct ps_prochandle *P, lwpid_t lwpid, const prfpregset_t *regs)
 160 {
 161         if (P->state != PS_STOP)
 162                 return (PS_ERR);
 163 
 164         if (Plwp_setfpregs(P, lwpid, regs) == 0)
 165                 return (PS_OK);
 166 
 167         return (PS_BADLID);
 168 }
 169 
 170 #if defined(sparc) || defined(__sparc)
 171 
 172 ps_err_e
 173 ps_lgetxregsize(struct ps_prochandle *P, lwpid_t lwpid, int *xrsize)
 174 {
 175         char fname[PATH_MAX];
 176         struct stat statb;
 177 
 178         if (P->state == PS_DEAD) {
 179                 core_info_t *core = P->data;
 180                 lwp_info_t *lwp = list_next(&core->core_lwp_head);
 181                 uint_t i;
 182 
 183                 for (i = 0; i < core->core_nlwp; i++, lwp = list_next(lwp)) {
 184                         if (lwp->lwp_id == lwpid) {
 185                                 if (lwp->lwp_xregs != NULL)
 186                                         *xrsize = sizeof (prxregset_t);
 187                                 else
 188                                         *xrsize = 0;
 189                                 return (PS_OK);
 190                         }
 191                 }
 192 
 193                 return (PS_BADLID);
 194         }
 195 
 196         (void) snprintf(fname, sizeof (fname), "%s/%d/lwp/%d/xregs",
 197             procfs_path, (int)P->status.pr_pid, (int)lwpid);
 198 
 199         if (stat(fname, &statb) != 0)
 200                 return (PS_BADLID);
 201 
 202         *xrsize = (int)statb.st_size;
 203         return (PS_OK);