98 virtual bool demangle(const char* symbol, char* buf, int buflen) {
99 return false;
100 }
101
102 virtual bool can_decode_C_frame_in_vm() const {
103 return false;
104 }
105 };
106
107
108 class Decoder : AllStatic {
109 public:
110 static bool decode(address pc, char* buf, int buflen, int* offset, const char* modulepath = NULL, bool demangle = true);
111 static bool decode(address pc, char* buf, int buflen, int* offset, bool demangle) {
112 return decode(pc, buf, buflen, offset, (const char*) NULL, demangle);
113 }
114 static bool decode(address pc, char* buf, int buflen, int* offset, const void* base);
115 static bool demangle(const char* symbol, char* buf, int buflen);
116 static bool can_decode_C_frame_in_vm();
117
118 // shutdown shared instance
119 static void shutdown();
120
121 static void print_state_on(outputStream* st);
122
123 protected:
124 // shared decoder instance, _shared_instance_lock is needed
125 static AbstractDecoder* get_shared_instance();
126 // a private instance for error handler. Error handler can be
127 // triggered almost everywhere, including signal handler, where
128 // no lock can be taken. So the shared decoder can not be used
129 // in this scenario.
130 static AbstractDecoder* get_error_handler_instance();
131
132 static AbstractDecoder* create_decoder();
133 private:
134 static AbstractDecoder* _shared_decoder;
135 static AbstractDecoder* _error_handler_decoder;
136 static NullDecoder _do_nothing_decoder;
137
|
98 virtual bool demangle(const char* symbol, char* buf, int buflen) {
99 return false;
100 }
101
102 virtual bool can_decode_C_frame_in_vm() const {
103 return false;
104 }
105 };
106
107
108 class Decoder : AllStatic {
109 public:
110 static bool decode(address pc, char* buf, int buflen, int* offset, const char* modulepath = NULL, bool demangle = true);
111 static bool decode(address pc, char* buf, int buflen, int* offset, bool demangle) {
112 return decode(pc, buf, buflen, offset, (const char*) NULL, demangle);
113 }
114 static bool decode(address pc, char* buf, int buflen, int* offset, const void* base);
115 static bool demangle(const char* symbol, char* buf, int buflen);
116 static bool can_decode_C_frame_in_vm();
117
118 // Attempts to retrieve source file name and line number associated with a pc.
119 // If buf != NULL, points to a buffer of size buflen which will receive the
120 // file name. File name will be silently truncated if output buffer is too small.
121 static bool get_source_info(address pc, char* buf, size_t buflen, int* line);
122
123 // shutdown shared instance
124 static void shutdown();
125
126 static void print_state_on(outputStream* st);
127
128 protected:
129 // shared decoder instance, _shared_instance_lock is needed
130 static AbstractDecoder* get_shared_instance();
131 // a private instance for error handler. Error handler can be
132 // triggered almost everywhere, including signal handler, where
133 // no lock can be taken. So the shared decoder can not be used
134 // in this scenario.
135 static AbstractDecoder* get_error_handler_instance();
136
137 static AbstractDecoder* create_decoder();
138 private:
139 static AbstractDecoder* _shared_decoder;
140 static AbstractDecoder* _error_handler_decoder;
141 static NullDecoder _do_nothing_decoder;
142
|