< prev index next >

src/os/aix/vm/porting_aix.cpp

Print this page




 132   // we read it (?).
 133   // As the pc cannot be trusted to be anything sensible lets make all reads via SafeFetch. Also
 134   // bail if this is not a text address right now.
 135   if (!LoadedLibraries::find_for_text_address(pc, NULL)) {
 136     trcVerbose("not a text address");
 137     return false;
 138   }
 139 
 140   // .. (Note that is_readable_pointer returns true if safefetch stubs are not there yet;
 141   // in that case I try reading the traceback table unsafe - I rather risk secondary crashes in
 142   // error files than not having a callstack.)
 143 #define CHECK_POINTER_READABLE(p) \
 144   if (!MiscUtils::is_readable_pointer(p)) { \
 145     trcVerbose("pc not readable"); \
 146     return false; \
 147   }
 148 
 149   codeptr_t pc2 = (codeptr_t) pc;
 150 
 151   // Make sure the pointer is word aligned.
 152   pc2 = (codeptr_t) align_ptr_up((char*)pc2, 4);
 153   CHECK_POINTER_READABLE(pc2)
 154 
 155   // Find start of traceback table.
 156   // (starts after code, is marked by word-aligned (32bit) zeros)
 157   while ((*pc2 != NULL) && (searchcount++ < MAX_FUNC_SEARCH_LEN)) {
 158     CHECK_POINTER_READABLE(pc2)
 159     pc2++;
 160   }
 161   if (*pc2 != 0) {
 162     trcVerbose("no traceback table found");
 163     return false;
 164   }
 165   //
 166   // Set up addressability to the traceback table
 167   //
 168   tb = (struct tbtable*) (pc2 + 1);
 169 
 170   // Is this really a traceback table? No way to be sure but
 171   // some indicators we can check.
 172   if (tb->tb.lang >= 0xf && tb->tb.lang <= 0xfb) {




 132   // we read it (?).
 133   // As the pc cannot be trusted to be anything sensible lets make all reads via SafeFetch. Also
 134   // bail if this is not a text address right now.
 135   if (!LoadedLibraries::find_for_text_address(pc, NULL)) {
 136     trcVerbose("not a text address");
 137     return false;
 138   }
 139 
 140   // .. (Note that is_readable_pointer returns true if safefetch stubs are not there yet;
 141   // in that case I try reading the traceback table unsafe - I rather risk secondary crashes in
 142   // error files than not having a callstack.)
 143 #define CHECK_POINTER_READABLE(p) \
 144   if (!MiscUtils::is_readable_pointer(p)) { \
 145     trcVerbose("pc not readable"); \
 146     return false; \
 147   }
 148 
 149   codeptr_t pc2 = (codeptr_t) pc;
 150 
 151   // Make sure the pointer is word aligned.
 152   pc2 = (codeptr_t) align_up((char*)pc2, 4);
 153   CHECK_POINTER_READABLE(pc2)
 154 
 155   // Find start of traceback table.
 156   // (starts after code, is marked by word-aligned (32bit) zeros)
 157   while ((*pc2 != NULL) && (searchcount++ < MAX_FUNC_SEARCH_LEN)) {
 158     CHECK_POINTER_READABLE(pc2)
 159     pc2++;
 160   }
 161   if (*pc2 != 0) {
 162     trcVerbose("no traceback table found");
 163     return false;
 164   }
 165   //
 166   // Set up addressability to the traceback table
 167   //
 168   tb = (struct tbtable*) (pc2 + 1);
 169 
 170   // Is this really a traceback table? No way to be sure but
 171   // some indicators we can check.
 172   if (tb->tb.lang >= 0xf && tb->tb.lang <= 0xfb) {


< prev index next >