< prev index next >

src/hotspot/share/utilities/vmError.cpp

Print this page

 328     // For JavaThread stack_base and stack_size should be set.
 329     if (!t->is_in_full_stack((address)(fr.real_fp() + 1))) {
 330       return invalid;
 331     }
 332     if (fr.is_java_frame() || fr.is_native_frame() || fr.is_runtime_frame()) {
 333       RegisterMap map(JavaThread::cast(t), false); // No update
 334       return fr.sender(&map);
 335     } else {
 336       // is_first_C_frame() does only simple checks for frame pointer,
 337       // it will pass if java compiled code has a pointer in EBP.
 338       if (os::is_first_C_frame(&fr)) return invalid;
 339       return os::get_sender_for_C_frame(&fr);
 340     }
 341   } else {
 342     if (os::is_first_C_frame(&fr)) return invalid;
 343     return os::get_sender_for_C_frame(&fr);
 344   }
 345 }
 346 
 347 void VMError::print_native_stack(outputStream* st, frame fr, Thread* t, char* buf, int buf_size) {
 348 

 349   // see if it's a valid frame
 350   if (fr.pc()) {
 351     st->print_cr("Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)");
 352 
 353     int count = 0;
 354     while (count++ < StackPrintLimit) {
 355       fr.print_on_error(st, buf, buf_size);
 356       if (fr.pc()) { // print source file and line, if available
 357         char buf[128];
 358         int line_no;
 359         if (Decoder::get_source_info(fr.pc(), buf, sizeof(buf), &line_no)) {
 360           st->print("  (%s:%d)", buf, line_no);
 361         }
 362       }
 363       st->cr();
 364       fr = next_frame(fr, t);
 365       if (fr.pc() == nullptr) {
 366         break;
 367       }
 368     }

 328     // For JavaThread stack_base and stack_size should be set.
 329     if (!t->is_in_full_stack((address)(fr.real_fp() + 1))) {
 330       return invalid;
 331     }
 332     if (fr.is_java_frame() || fr.is_native_frame() || fr.is_runtime_frame()) {
 333       RegisterMap map(JavaThread::cast(t), false); // No update
 334       return fr.sender(&map);
 335     } else {
 336       // is_first_C_frame() does only simple checks for frame pointer,
 337       // it will pass if java compiled code has a pointer in EBP.
 338       if (os::is_first_C_frame(&fr)) return invalid;
 339       return os::get_sender_for_C_frame(&fr);
 340     }
 341   } else {
 342     if (os::is_first_C_frame(&fr)) return invalid;
 343     return os::get_sender_for_C_frame(&fr);
 344   }
 345 }
 346 
 347 void VMError::print_native_stack(outputStream* st, frame fr, Thread* t, char* buf, int buf_size) {
 348   if (t != NULL) st->print_cr("Thread " INTPTR_FORMAT " [%ld]", p2i(t), (long) t->osthread()->thread_id());
 349   
 350   // see if it's a valid frame
 351   if (fr.pc()) {
 352     st->print_cr("Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)");
 353 
 354     int count = 0;
 355     while (count++ < StackPrintLimit) {
 356       fr.print_on_error(st, buf, buf_size);
 357       if (fr.pc()) { // print source file and line, if available
 358         char buf[128];
 359         int line_no;
 360         if (Decoder::get_source_info(fr.pc(), buf, sizeof(buf), &line_no)) {
 361           st->print("  (%s:%d)", buf, line_no);
 362         }
 363       }
 364       st->cr();
 365       fr = next_frame(fr, t);
 366       if (fr.pc() == nullptr) {
 367         break;
 368       }
 369     }
< prev index next >