Print this page
27908 ::gcore breaks sparc build


 170                                             &gwin.wbuf[i],
 171                                             sizeof (struct rwindow));
 172 
 173                                         rv = 1; /* We're done */
 174                                         break;
 175                                 }
 176                         }
 177                 }
 178                 (void) close(fd);
 179         }
 180 
 181         return (rv);
 182 }
 183 
 184 static int
 185 read_gwin(struct ps_prochandle *P, struct rwindow *rwp, uintptr_t sp)
 186 {
 187         gwin_query_t gq;
 188 
 189         if (P->state == PS_DEAD) {
 190                 lwp_info_t *lwp = list_next(&P->core->core_lwp_head);

 191                 uint_t n;
 192                 int i;
 193 
 194                 for (n = 0; n < P->core->core_nlwp; n++, lwp = list_next(lwp)) {
 195                         gwindows_t *gwin = lwp->lwp_gwins;
 196 
 197                         if (gwin == NULL)
 198                                 continue; /* No gwindows for this lwp */
 199 
 200                         /*
 201                          * If this lwp has gwindows associated with it, iterate
 202                          * through the buffers looking for a stack pointer
 203                          * match; if one is found, copy out the register window.
 204                          */
 205                         for (i = 0; i < gwin->wbcnt; i++) {
 206                                 if (gwin->spbuf[i] == (greg_t *)sp) {
 207                                         (void) memcpy(rwp, &gwin->wbuf[i],
 208                                             sizeof (struct rwindow));
 209                                         return (0); /* We're done */
 210                                 }
 211                         }
 212                 }
 213 
 214                 return (-1); /* No gwindows match found */




 170                                             &gwin.wbuf[i],
 171                                             sizeof (struct rwindow));
 172 
 173                                         rv = 1; /* We're done */
 174                                         break;
 175                                 }
 176                         }
 177                 }
 178                 (void) close(fd);
 179         }
 180 
 181         return (rv);
 182 }
 183 
 184 static int
 185 read_gwin(struct ps_prochandle *P, struct rwindow *rwp, uintptr_t sp)
 186 {
 187         gwin_query_t gq;
 188 
 189         if (P->state == PS_DEAD) {
 190                 core_info_t *core = P->data;
 191                 lwp_info_t *lwp = list_next(&core->core_lwp_head);
 192                 uint_t n;
 193                 int i;
 194 
 195                 for (n = 0; n < core->core_nlwp; n++, lwp = list_next(lwp)) {
 196                         gwindows_t *gwin = lwp->lwp_gwins;
 197 
 198                         if (gwin == NULL)
 199                                 continue; /* No gwindows for this lwp */
 200 
 201                         /*
 202                          * If this lwp has gwindows associated with it, iterate
 203                          * through the buffers looking for a stack pointer
 204                          * match; if one is found, copy out the register window.
 205                          */
 206                         for (i = 0; i < gwin->wbcnt; i++) {
 207                                 if (gwin->spbuf[i] == (greg_t *)sp) {
 208                                         (void) memcpy(rwp, &gwin->wbuf[i],
 209                                             sizeof (struct rwindow));
 210                                         return (0); /* We're done */
 211                                 }
 212                         }
 213                 }
 214 
 215                 return (-1); /* No gwindows match found */