436 } else if (_message) { 437 st->print_cr("# Error: %s", _message); 438 } 439 } 440 441 STEP(50, "(printing Java version string)") 442 443 // VM version 444 st->print_cr("#"); 445 JDK_Version::current().to_string(buf, sizeof(buf)); 446 st->print_cr("# JRE version: %s", buf); 447 st->print_cr("# Java VM: %s (%s %s %s %s)", 448 Abstract_VM_Version::vm_name(), 449 Abstract_VM_Version::vm_release(), 450 Abstract_VM_Version::vm_info_string(), 451 Abstract_VM_Version::vm_platform_string(), 452 UseCompressedOops ? "compressed oops" : "" 453 ); 454 455 STEP(60, "(printing problematic frame)") 456 457 // Print current frame if we have a context (i.e. it's a crash) 458 if (_context) { 459 st->print_cr("# Problematic frame:"); 460 st->print("# "); 461 frame fr = os::fetch_frame_from_context(_context); 462 fr.print_on_error(st, buf, sizeof(buf)); 463 st->cr(); 464 st->print_cr("#"); 465 } 466 STEP(63, "(printing core file information)") 467 st->print("# "); 468 if (coredump_status) { 469 st->print("Core dump written. Default location: %s", coredump_message); 470 } else { 471 st->print("Failed to write core dump. %s", coredump_message); 472 } 473 st->print_cr(""); 474 st->print_cr("#"); 475 549 550 if (fr.sp()) { 551 st->print(", sp=" PTR_FORMAT, fr.sp()); 552 size_t free_stack_size = pointer_delta(fr.sp(), stack_bottom, 1024); 553 st->print(", free space=" SIZE_FORMAT "k", free_stack_size); 554 } 555 556 st->cr(); 557 } 558 559 STEP(120, "(printing native stack)" ) 560 561 if (_verbose) { 562 frame fr = _context ? os::fetch_frame_from_context(_context) 563 : os::current_frame(); 564 565 // see if it's a valid frame 566 if (fr.pc()) { 567 st->print_cr("Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)"); 568 569 // initialize decoder to decode C frames 570 Decoder decoder; 571 572 int count = 0; 573 while (count++ < StackPrintLimit) { 574 fr.print_on_error(st, buf, sizeof(buf)); 575 st->cr(); 576 if (os::is_first_C_frame(&fr)) break; 577 fr = os::get_sender_for_C_frame(&fr); 578 } 579 580 if (count > StackPrintLimit) { 581 st->print_cr("...<more frames>..."); 582 } 583 584 st->cr(); 585 } 586 } 587 588 STEP(130, "(printing Java stack)" ) 589 590 if (_verbose && _thread && _thread->is_Java_thread()) { 591 print_stack_trace(st, (JavaThread*)_thread, buf, sizeof(buf)); | 436 } else if (_message) { 437 st->print_cr("# Error: %s", _message); 438 } 439 } 440 441 STEP(50, "(printing Java version string)") 442 443 // VM version 444 st->print_cr("#"); 445 JDK_Version::current().to_string(buf, sizeof(buf)); 446 st->print_cr("# JRE version: %s", buf); 447 st->print_cr("# Java VM: %s (%s %s %s %s)", 448 Abstract_VM_Version::vm_name(), 449 Abstract_VM_Version::vm_release(), 450 Abstract_VM_Version::vm_info_string(), 451 Abstract_VM_Version::vm_platform_string(), 452 UseCompressedOops ? "compressed oops" : "" 453 ); 454 455 STEP(60, "(printing problematic frame)") 456 // initialize decoder to decode C frames 457 Decoder decoder; 458 459 // Print current frame if we have a context (i.e. it's a crash) 460 if (_context) { 461 st->print_cr("# Problematic frame:"); 462 st->print("# "); 463 frame fr = os::fetch_frame_from_context(_context); 464 fr.print_on_error(st, buf, sizeof(buf)); 465 st->cr(); 466 st->print_cr("#"); 467 } 468 STEP(63, "(printing core file information)") 469 st->print("# "); 470 if (coredump_status) { 471 st->print("Core dump written. Default location: %s", coredump_message); 472 } else { 473 st->print("Failed to write core dump. %s", coredump_message); 474 } 475 st->print_cr(""); 476 st->print_cr("#"); 477 551 552 if (fr.sp()) { 553 st->print(", sp=" PTR_FORMAT, fr.sp()); 554 size_t free_stack_size = pointer_delta(fr.sp(), stack_bottom, 1024); 555 st->print(", free space=" SIZE_FORMAT "k", free_stack_size); 556 } 557 558 st->cr(); 559 } 560 561 STEP(120, "(printing native stack)" ) 562 563 if (_verbose) { 564 frame fr = _context ? os::fetch_frame_from_context(_context) 565 : os::current_frame(); 566 567 // see if it's a valid frame 568 if (fr.pc()) { 569 st->print_cr("Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)"); 570 571 int count = 0; 572 while (count++ < StackPrintLimit) { 573 fr.print_on_error(st, buf, sizeof(buf)); 574 st->cr(); 575 if (os::is_first_C_frame(&fr)) break; 576 fr = os::get_sender_for_C_frame(&fr); 577 } 578 579 if (count > StackPrintLimit) { 580 st->print_cr("...<more frames>..."); 581 } 582 583 st->cr(); 584 } 585 } 586 587 STEP(130, "(printing Java stack)" ) 588 589 if (_verbose && _thread && _thread->is_Java_thread()) { 590 print_stack_trace(st, (JavaThread*)_thread, buf, sizeof(buf)); |