< prev index next >

src/hotspot/share/utilities/vmError.cpp

Print this page

 929 
 930   STEP("inspecting top of stack")
 931 
 932      // decode stack contents if possible
 933      if (_verbose && _context && _thread && Universe::is_fully_initialized()) {
 934        frame fr = os::fetch_frame_from_context(_context);
 935        const int slots = 8;
 936        const intptr_t *start = fr.sp();
 937        const intptr_t *end = start + slots;
 938        if (is_aligned(start, sizeof(intptr_t)) && os::is_readable_range(start, end)) {
 939          st->print_cr("Stack slot to memory mapping:");
 940          for (int i = 0; i < slots; ++i) {
 941            st->print("stack at sp + %d slots: ", i);
 942            ResourceMark rm(_thread);
 943            os::print_location(st, *(start + i));
 944          }
 945        }
 946        st->cr();
 947      }
 948 








 949   STEP("printing code blobs if possible")
 950 
 951      if (_verbose) {
 952        const int printed_capacity = max_error_log_print_code;
 953        address printed[printed_capacity];
 954        printed[0] = nullptr;
 955        int printed_len = 0;
 956        // Even though ErrorLogPrintCodeLimit is ranged checked
 957        // during argument parsing, there's no way to prevent it
 958        // subsequently (i.e., after parsing) being set to a
 959        // value outside the range.
 960        int limit = MIN2(ErrorLogPrintCodeLimit, printed_capacity);
 961        if (limit > 0) {
 962          // Check if a pc was found by native stack trace above.
 963          if (lastpc != nullptr) {
 964            if (print_code(st, _thread, lastpc, true, printed, printed_capacity)) {
 965              printed_len++;
 966            }
 967          }
 968 

 929 
 930   STEP("inspecting top of stack")
 931 
 932      // decode stack contents if possible
 933      if (_verbose && _context && _thread && Universe::is_fully_initialized()) {
 934        frame fr = os::fetch_frame_from_context(_context);
 935        const int slots = 8;
 936        const intptr_t *start = fr.sp();
 937        const intptr_t *end = start + slots;
 938        if (is_aligned(start, sizeof(intptr_t)) && os::is_readable_range(start, end)) {
 939          st->print_cr("Stack slot to memory mapping:");
 940          for (int i = 0; i < slots; ++i) {
 941            st->print("stack at sp + %d slots: ", i);
 942            ResourceMark rm(_thread);
 943            os::print_location(st, *(start + i));
 944          }
 945        }
 946        st->cr();
 947      }
 948 
 949   STEP("printing lock stack")
 950 
 951     if (_verbose && _thread != nullptr && _thread->is_Java_thread() && LockingMode == LM_LIGHTWEIGHT) {
 952       st->print_cr("Lock stack of current Java thread (top to bottom):");
 953       _thread->as_Java_thread()->lock_stack().print_on(st);
 954       st->cr();
 955     }
 956 
 957   STEP("printing code blobs if possible")
 958 
 959      if (_verbose) {
 960        const int printed_capacity = max_error_log_print_code;
 961        address printed[printed_capacity];
 962        printed[0] = nullptr;
 963        int printed_len = 0;
 964        // Even though ErrorLogPrintCodeLimit is ranged checked
 965        // during argument parsing, there's no way to prevent it
 966        // subsequently (i.e., after parsing) being set to a
 967        // value outside the range.
 968        int limit = MIN2(ErrorLogPrintCodeLimit, printed_capacity);
 969        if (limit > 0) {
 970          // Check if a pc was found by native stack trace above.
 971          if (lastpc != nullptr) {
 972            if (print_code(st, _thread, lastpc, true, printed, printed_capacity)) {
 973              printed_len++;
 974            }
 975          }
 976 
< prev index next >