Print this page
27908 ::gcore breaks sparc build


 218                                             &gwin.wbuf[i],
 219                                             sizeof (struct rwindow));
 220 
 221                                         rv = 1; /* We're done */
 222                                         break;
 223                                 }
 224                         }
 225                 }
 226                 (void) close(fd);
 227         }
 228 
 229         return (rv);
 230 }
 231 
 232 static int
 233 read_gwin(struct ps_prochandle *P, struct rwindow *rwp, uintptr_t sp)
 234 {
 235         gwin_query_t gq;
 236 
 237         if (P->state == PS_DEAD) {
 238                 lwp_info_t *lwp = list_next(&P->core->core_lwp_head);

 239                 uint_t n;
 240                 int i;
 241 
 242                 for (n = 0; n < P->core->core_nlwp; n++, lwp = list_next(lwp)) {
 243                         gwindows_t *gwin = lwp->lwp_gwins;
 244 
 245                         if (gwin == NULL)
 246                                 continue; /* No gwindows for this lwp */
 247 
 248                         /*
 249                          * If this lwp has gwindows associated with it, iterate
 250                          * through the buffers looking for a stack pointer
 251                          * match; if one is found, copy out the register window.
 252                          */
 253                         for (i = 0; i < gwin->wbcnt; i++) {
 254                                 if (gwin->spbuf[i] == (greg_t *)sp) {
 255                                         (void) memcpy(rwp, &gwin->wbuf[i],
 256                                             sizeof (struct rwindow));
 257                                         return (0); /* We're done */
 258                                 }
 259                         }
 260                 }
 261 
 262                 return (-1); /* No gwindows match found */




 218                                             &gwin.wbuf[i],
 219                                             sizeof (struct rwindow));
 220 
 221                                         rv = 1; /* We're done */
 222                                         break;
 223                                 }
 224                         }
 225                 }
 226                 (void) close(fd);
 227         }
 228 
 229         return (rv);
 230 }
 231 
 232 static int
 233 read_gwin(struct ps_prochandle *P, struct rwindow *rwp, uintptr_t sp)
 234 {
 235         gwin_query_t gq;
 236 
 237         if (P->state == PS_DEAD) {
 238                 core_info_t *core = P->data;
 239                 lwp_info_t *lwp = list_next(&core->core_lwp_head);
 240                 uint_t n;
 241                 int i;
 242 
 243                 for (n = 0; n < core->core_nlwp; n++, lwp = list_next(lwp)) {
 244                         gwindows_t *gwin = lwp->lwp_gwins;
 245 
 246                         if (gwin == NULL)
 247                                 continue; /* No gwindows for this lwp */
 248 
 249                         /*
 250                          * If this lwp has gwindows associated with it, iterate
 251                          * through the buffers looking for a stack pointer
 252                          * match; if one is found, copy out the register window.
 253                          */
 254                         for (i = 0; i < gwin->wbcnt; i++) {
 255                                 if (gwin->spbuf[i] == (greg_t *)sp) {
 256                                         (void) memcpy(rwp, &gwin->wbuf[i],
 257                                             sizeof (struct rwindow));
 258                                         return (0); /* We're done */
 259                                 }
 260                         }
 261                 }
 262 
 263                 return (-1); /* No gwindows match found */