< prev index next >

src/hotspot/share/utilities/vmError.cpp

Print this page
rev 52037 : 8211852: inspect stack during error reporting
Reviewed-by:

@@ -746,10 +746,28 @@
      if (_verbose && _context && Universe::is_fully_initialized()) {
        os::print_register_info(st, _context);
        st->cr();
      }
 
+  STEP("printing top of stack info")
+
+     // decode stack contents if possible
+     if (_verbose && _context && Universe::is_fully_initialized()) {
+       frame fr = os::fetch_frame_from_context(_context);
+       const int slots = 8;
+       const intptr_t *start = fr.sp();
+       const intptr_t *end = start + slots;
+       if (is_aligned(start, sizeof(intptr_t)) && os::is_readable_range(start, end)) {
+         st->print_cr("Stack slot to memory mapping:");
+         for (int i = 0; i < slots; ++i) {
+           st->print("stack at sp + %d slots: ", i);
+           os::print_location(st, *(start + i));
+         }
+       }
+       st->cr();
+     }
+
   STEP("printing registers, top of stack, instructions near pc")
 
      // registers, top of stack, instructions near pc
      if (_verbose && _context) {
        os::print_context(st, _context);
< prev index next >