< prev index next >

src/share/vm/runtime/frame.cpp

Print this page
rev 13549 : 8185712: [windows] Improve native symbol decoder
Reviewed-by: goetz, zgu


 610   // C/C++ frame
 611   bool in_vm = os::address_is_in_vm(pc);
 612   st->print(in_vm ? "V" : "C");
 613 
 614   int offset;
 615   bool found;
 616 
 617   // libname
 618   found = os::dll_address_to_library_name(pc, buf, buflen, &offset);
 619   if (found) {
 620     // skip directory names
 621     const char *p1, *p2;
 622     p1 = buf;
 623     int len = (int)strlen(os::file_separator());
 624     while ((p2 = strstr(p1, os::file_separator())) != NULL) p1 = p2 + len;
 625     st->print("  [%s+0x%x]", p1, offset);
 626   } else {
 627     st->print("  " PTR_FORMAT, p2i(pc));
 628   }
 629 
 630   // function name - os::dll_address_to_function_name() may return confusing
 631   // names if pc is within jvm.dll or libjvm.so, because JVM only has
 632   // JVM_xxxx and a few other symbols in the dynamic symbol table. Do this
 633   // only for native libraries.
 634   if (!in_vm || Decoder::can_decode_C_frame_in_vm()) {
 635     found = os::dll_address_to_function_name(pc, buf, buflen, &offset);
 636 
 637     if (found) {
 638       st->print("  %s+0x%x", buf, offset);
 639     }
 640   }
 641 }
 642 
 643 // frame::print_on_error() is called by fatal error handler. Notice that we may
 644 // crash inside this function if stack frame is corrupted. The fatal error
 645 // handler can catch and handle the crash. Here we assume the frame is valid.
 646 //
 647 // First letter indicates type of the frame:
 648 //    J: Java frame (compiled)
 649 //    A: Java frame (aot compiled)
 650 //    j: Java frame (interpreted)
 651 //    V: VM frame (C/C++)
 652 //    v: Other frames running VM generated code (e.g. stubs, adapters, etc.)
 653 //    C: C/C++ frame
 654 //
 655 // We don't need detailed frame type as that in frame::print_name(). "C"
 656 // suggests the problem is in user lib; everything else is likely a VM bug.
 657 
 658 void frame::print_on_error(outputStream* st, char* buf, int buflen, bool verbose) const {
 659   if (_cb != NULL) {




 610   // C/C++ frame
 611   bool in_vm = os::address_is_in_vm(pc);
 612   st->print(in_vm ? "V" : "C");
 613 
 614   int offset;
 615   bool found;
 616 
 617   // libname
 618   found = os::dll_address_to_library_name(pc, buf, buflen, &offset);
 619   if (found) {
 620     // skip directory names
 621     const char *p1, *p2;
 622     p1 = buf;
 623     int len = (int)strlen(os::file_separator());
 624     while ((p2 = strstr(p1, os::file_separator())) != NULL) p1 = p2 + len;
 625     st->print("  [%s+0x%x]", p1, offset);
 626   } else {
 627     st->print("  " PTR_FORMAT, p2i(pc));
 628   }
 629 





 630   found = os::dll_address_to_function_name(pc, buf, buflen, &offset);

 631   if (found) {
 632     st->print("  %s+0x%x", buf, offset);

 633   }
 634 }
 635 
 636 // frame::print_on_error() is called by fatal error handler. Notice that we may
 637 // crash inside this function if stack frame is corrupted. The fatal error
 638 // handler can catch and handle the crash. Here we assume the frame is valid.
 639 //
 640 // First letter indicates type of the frame:
 641 //    J: Java frame (compiled)
 642 //    A: Java frame (aot compiled)
 643 //    j: Java frame (interpreted)
 644 //    V: VM frame (C/C++)
 645 //    v: Other frames running VM generated code (e.g. stubs, adapters, etc.)
 646 //    C: C/C++ frame
 647 //
 648 // We don't need detailed frame type as that in frame::print_name(). "C"
 649 // suggests the problem is in user lib; everything else is likely a VM bug.
 650 
 651 void frame::print_on_error(outputStream* st, char* buf, int buflen, bool verbose) const {
 652   if (_cb != NULL) {


< prev index next >