Print this page




 105         char                    *stack[1]; /* actual length is max(1,nstack) */
 106 } *list = NULL;
 107 
 108 #ifdef __sparcv9
 109 #define FRAMEP(X)       (struct frame *)((char*)(X)+(((long)(X)&1)?2047:0))
 110 #else
 111 #define FRAMEP(X)       (struct frame *)(X)
 112 #endif
 113 
 114 #ifdef _LP64
 115 #define PDIG            "16"
 116 #else
 117 #define PDIG            "8"
 118 #endif
 119 
 120 /* look for a matching exc_list; return 1 if one is found,
 121    otherwise add this one to the list and return 0 */
 122 static int check_exc_list(char *addr, unsigned long code, char *stk,
 123     struct frame *fp)
 124 {
 125         struct exc_list *l, *ll;
 126         struct frame    *f;
 127         int             i, n;
 128 
 129         if (list) {
 130                 for (l = list; l; ll = l, l = l->next) {
 131                         if (l->addr != addr || l->code != code)
 132                                 continue;
 133                         if (log_depth < 1 || l->nstack < 1)
 134                                 return 1;
 135                         if (l->stack[0] != stk)
 136                                 continue;
 137                         n = 1;
 138                         for (i = 1, f = fp; i < log_depth && i < l->nstack &&
 139                             f && f->fr_savpc; i++, f = FRAMEP(f->fr_savfp))
 140                                 if (l->stack[i] != (char *)f->fr_savpc) {
 141                                         n = 0;
 142                                         break;
 143                                 }
 144                         if (n)
 145                                 return 1;




 105         char                    *stack[1]; /* actual length is max(1,nstack) */
 106 } *list = NULL;
 107 
 108 #ifdef __sparcv9
 109 #define FRAMEP(X)       (struct frame *)((char*)(X)+(((long)(X)&1)?2047:0))
 110 #else
 111 #define FRAMEP(X)       (struct frame *)(X)
 112 #endif
 113 
 114 #ifdef _LP64
 115 #define PDIG            "16"
 116 #else
 117 #define PDIG            "8"
 118 #endif
 119 
 120 /* look for a matching exc_list; return 1 if one is found,
 121    otherwise add this one to the list and return 0 */
 122 static int check_exc_list(char *addr, unsigned long code, char *stk,
 123     struct frame *fp)
 124 {
 125         struct exc_list *l, *ll = NULL;
 126         struct frame    *f;
 127         int             i, n;
 128 
 129         if (list) {
 130                 for (l = list; l; ll = l, l = l->next) {
 131                         if (l->addr != addr || l->code != code)
 132                                 continue;
 133                         if (log_depth < 1 || l->nstack < 1)
 134                                 return 1;
 135                         if (l->stack[0] != stk)
 136                                 continue;
 137                         n = 1;
 138                         for (i = 1, f = fp; i < log_depth && i < l->nstack &&
 139                             f && f->fr_savpc; i++, f = FRAMEP(f->fr_savfp))
 140                                 if (l->stack[i] != (char *)f->fr_savpc) {
 141                                         n = 0;
 142                                         break;
 143                                 }
 144                         if (n)
 145                                 return 1;