Changeset 14977
- Timestamp:
- Sep 9, 2011, 3:14:48 PM (13 years ago)
- File:
-
- 1 edited
-
trunk/source/lisp-kernel/xlbt.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/lisp-kernel/xlbt.c
r14619 r14977 19 19 #include <signal.h> 20 20 21 21 static LispObj 22 function_to_function_vector(LispObj f) 23 { 24 #ifdef X8664 25 return f - fulltag_function + fulltag_misc; 26 #else 27 return f; 28 #endif 29 } 30 31 static Boolean 32 functionp(LispObj f) 33 { 34 #ifdef X8664 35 return fulltag_of(f) == fulltag_function; 36 #else 37 return fulltag_of(f) == fulltag_misc && 38 header_subtag(header_of(f)) == subtag_function; 39 #endif 40 } 41 42 static LispObj 43 tra_function(LispObj tra) 44 { 45 LispObj f = 0; 46 47 #ifdef X8664 48 if (tag_of(tra) == tag_tra) { 49 if ((*((unsigned short *)tra) == RECOVER_FN_FROM_RIP_WORD0) && 50 (*((unsigned char *)(tra+2)) == RECOVER_FN_FROM_RIP_BYTE2)) { 51 int sdisp = (*(int *) (tra+3)); 52 f = RECOVER_FN_FROM_RIP_LENGTH+tra+sdisp; 53 } 54 } 55 #else 56 if (fulltag_of(tra) == fulltag_tra) { 57 if (*((unsigned char *)tra) == RECOVER_FN_OPCODE) { 58 natural n = *((natural *)(tra + 1)); 59 f = (LispObj)n; 60 } 61 } 62 #endif 63 return f; 64 } 65 66 #if 0 67 /* untested */ 68 static int 69 tra_offset(LispObj tra) 70 { 71 #ifdef X8664 72 if (tag_of(tra) == tag_tra) { 73 if ((*((unsigned short *)tra) == RECOVER_FN_FROM_RIP_WORD0) && 74 (*((unsigned char *)(tra+2)) == RECOVER_FN_FROM_RIP_BYTE2)) { 75 int sdisp = (*(int *) (tra+3)); 76 77 sdisp = - sdisp; 78 sdisp -= RECOVER_FN_FROM_RIP_LENGTH; 79 return sdisp; 80 } 81 } 82 #else 83 if (fulltag_of(tra) == fulltag_tra) { 84 if (*((unsigned char *)tra) == RECOVER_FN_OPCODE) { 85 int n = *((int *)(tra + 1)); 86 n = n - tra; 87 n = -n; 88 return n; 89 } 90 } 91 #endif 92 return 0; 93 } 94 #endif 95 96 natural 97 pc_from_xcf(xcf *xcf) 98 { 99 if (functionp(xcf->nominal_function)) { 100 LispObj fv = function_to_function_vector(xcf->nominal_function); 101 if (fv == xcf->containing_uvector) { 102 unsigned tag; 103 104 #ifdef X8664 105 tag = tag_function; 106 #else 107 tag = fulltag_misc; 108 #endif 109 return unbox_fixnum(xcf->relative_pc) - tag; 110 } else { 111 LispObj tra = xcf->ra0; 112 LispObj f = tra_function(tra); 113 114 if (f && f == xcf->nominal_function) 115 return 0; /* punt for now */ 116 } 117 } 118 return 0; 119 } 22 120 23 121 void … … 43 141 } 44 142 if (pc == 0) { 143 natural rpc = pc_from_xcf((xcf *)frame); 144 45 145 fun = ((xcf *)frame)->nominal_function; 46 Dprintf("(#x%08X) #x%08X : %s + ??", frame, pc, print_lisp_object(fun)); 146 fprintf(dbgout, "(#x%08X) #x%08X : %s + ", frame, pc, 147 print_lisp_object(fun)); 148 if (rpc) 149 fprintf(dbgout, "%d\n", rpc); 150 else 151 fprintf(dbgout, "??\n", rpc); 47 152 return; 48 153 } … … 61 166 } 62 167 if (pc == 0) { 168 natural rpc = pc_from_xcf((xcf *)frame); 169 63 170 fun = ((xcf *)frame)->nominal_function; 64 Dprintf("(#x%016lX) #x%016lX : %s + ??", frame, pc, print_lisp_object(fun)); 171 fprintf(dbgout, "(#x%016lX) #x%016lX : %s + ", frame, pc, 172 print_lisp_object(fun)); 173 if (rpc) 174 fprintf(dbgout, "%d\n", rpc); 175 else 176 fprintf(dbgout, "??\n"); 65 177 return; 66 178 }
Note:
See TracChangeset
for help on using the changeset viewer.
