< prev index next >

src/hotspot/share/utilities/decoder.cpp

Print this page
rev 56552 : imported patch 8218543-2


  67   decoder = new (std::nothrow)AIXDecoder();
  68 #else
  69   decoder = new (std::nothrow)ElfDecoder();
  70 #endif
  71 
  72   if (decoder == NULL || decoder->has_error()) {
  73     if (decoder != NULL) {
  74       delete decoder;
  75     }
  76     decoder = &_do_nothing_decoder;
  77   }
  78   return decoder;
  79 }
  80 
  81 Mutex* Decoder::shared_decoder_lock() {
  82   assert(SharedDecoder_lock != NULL, "Just check");
  83   return SharedDecoder_lock;
  84 }
  85 
  86 bool Decoder::decode(address addr, char* buf, int buflen, int* offset, const char* modulepath, bool demangle) {
  87   bool error_handling_thread = os::current_thread_id() == VMError::first_error_tid;
  88   if (error_handling_thread) {
  89     return get_error_handler_instance()->decode(addr, buf, buflen, offset, modulepath, demangle);
  90   } else {
  91     MutexLocker locker(shared_decoder_lock(), Mutex::_no_safepoint_check_flag);
  92     return get_shared_instance()->decode(addr, buf, buflen, offset, modulepath, demangle);
  93   }
  94 
  95 }
  96 
  97 bool Decoder::decode(address addr, char* buf, int buflen, int* offset, const void* base) {
  98   bool error_handling_thread = os::current_thread_id() == VMError::first_error_tid;
  99   if (error_handling_thread) {
 100     return get_error_handler_instance()->decode(addr, buf, buflen, offset, base);
 101   } else {
 102     MutexLocker locker(shared_decoder_lock(), Mutex::_no_safepoint_check_flag);
 103     return get_shared_instance()->decode(addr, buf, buflen, offset, base);
 104   }
 105 }
 106 
 107 
 108 bool Decoder::demangle(const char* symbol, char* buf, int buflen) {
 109   bool error_handling_thread = os::current_thread_id() == VMError::first_error_tid;
 110   if (error_handling_thread) {
 111     return get_error_handler_instance()->demangle(symbol, buf, buflen);
 112   } else {
 113     MutexLocker locker(shared_decoder_lock(), Mutex::_no_safepoint_check_flag);
 114     return get_shared_instance()->demangle(symbol, buf, buflen);
 115   }
 116 }
 117 
 118 void Decoder::print_state_on(outputStream* st) {
 119 }
 120 
 121 bool Decoder::get_source_info(address pc, char* buf, size_t buflen, int* line) {
 122   return false;
 123 }
 124 
 125 #endif // !_WINDOWS
 126 


  67   decoder = new (std::nothrow)AIXDecoder();
  68 #else
  69   decoder = new (std::nothrow)ElfDecoder();
  70 #endif
  71 
  72   if (decoder == NULL || decoder->has_error()) {
  73     if (decoder != NULL) {
  74       delete decoder;
  75     }
  76     decoder = &_do_nothing_decoder;
  77   }
  78   return decoder;
  79 }
  80 
  81 Mutex* Decoder::shared_decoder_lock() {
  82   assert(SharedDecoder_lock != NULL, "Just check");
  83   return SharedDecoder_lock;
  84 }
  85 
  86 bool Decoder::decode(address addr, char* buf, int buflen, int* offset, const char* modulepath, bool demangle) {
  87   bool error_handling_thread = os::current_thread_id() == VMError::get_first_error_tid();
  88   if (error_handling_thread) {
  89     return get_error_handler_instance()->decode(addr, buf, buflen, offset, modulepath, demangle);
  90   } else {
  91     MutexLocker locker(shared_decoder_lock(), Mutex::_no_safepoint_check_flag);
  92     return get_shared_instance()->decode(addr, buf, buflen, offset, modulepath, demangle);
  93   }
  94 
  95 }
  96 
  97 bool Decoder::decode(address addr, char* buf, int buflen, int* offset, const void* base) {
  98   bool error_handling_thread = os::current_thread_id() == VMError::get_first_error_tid();
  99   if (error_handling_thread) {
 100     return get_error_handler_instance()->decode(addr, buf, buflen, offset, base);
 101   } else {
 102     MutexLocker locker(shared_decoder_lock(), Mutex::_no_safepoint_check_flag);
 103     return get_shared_instance()->decode(addr, buf, buflen, offset, base);
 104   }
 105 }
 106 
 107 
 108 bool Decoder::demangle(const char* symbol, char* buf, int buflen) {
 109   bool error_handling_thread = os::current_thread_id() == VMError::get_first_error_tid();
 110   if (error_handling_thread) {
 111     return get_error_handler_instance()->demangle(symbol, buf, buflen);
 112   } else {
 113     MutexLocker locker(shared_decoder_lock(), Mutex::_no_safepoint_check_flag);
 114     return get_shared_instance()->demangle(symbol, buf, buflen);
 115   }
 116 }
 117 
 118 void Decoder::print_state_on(outputStream* st) {
 119 }
 120 
 121 bool Decoder::get_source_info(address pc, char* buf, size_t buflen, int* line) {
 122   return false;
 123 }
 124 
 125 #endif // !_WINDOWS
 126 
< prev index next >