Mercurial > hg > truffle
annotate src/share/vm/utilities/debug.hpp @ 5553:511612d1b5c1
Fix renamings in C++ part.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Sat, 09 Jun 2012 22:50:50 +0200 |
parents | aa3d708d67c4 |
children | 6c5b7a6becc8 |
rev | line source |
---|---|
0 | 1 /* |
4872
aa3d708d67c4
7141200: log some interesting information in ring buffers for crashes
never
parents:
2426
diff
changeset
|
2 * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. |
0 | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | |
5 * This code is free software; you can redistribute it and/or modify it | |
6 * under the terms of the GNU General Public License version 2 only, as | |
7 * published by the Free Software Foundation. | |
8 * | |
9 * This code is distributed in the hope that it will be useful, but WITHOUT | |
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
12 * version 2 for more details (a copy is included in the LICENSE file that | |
13 * accompanied this code). | |
14 * | |
15 * You should have received a copy of the GNU General Public License version | |
16 * 2 along with this work; if not, write to the Free Software Foundation, | |
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |
18 * | |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1490
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1490
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1490
diff
changeset
|
21 * questions. |
0 | 22 * |
23 */ | |
24 | |
1972 | 25 #ifndef SHARE_VM_UTILITIES_DEBUG_HPP |
26 #define SHARE_VM_UTILITIES_DEBUG_HPP | |
27 | |
2361 | 28 #include "prims/jvm.h" |
1972 | 29 #include "utilities/globalDefinitions.hpp" |
30 | |
1490
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
31 #include <stdarg.h> |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
32 |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
33 // Simple class to format the ctor arguments into a fixed-sized buffer. |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
34 template <size_t bufsz = 256> |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
35 class FormatBuffer { |
4872
aa3d708d67c4
7141200: log some interesting information in ring buffers for crashes
never
parents:
2426
diff
changeset
|
36 public: |
1490
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
37 inline FormatBuffer(const char * format, ...); |
2152 | 38 inline void append(const char* format, ...); |
4872
aa3d708d67c4
7141200: log some interesting information in ring buffers for crashes
never
parents:
2426
diff
changeset
|
39 inline void print(const char* format, ...); |
aa3d708d67c4
7141200: log some interesting information in ring buffers for crashes
never
parents:
2426
diff
changeset
|
40 inline void printv(const char* format, va_list ap); |
1490
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
41 operator const char *() const { return _buf; } |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
42 |
4872
aa3d708d67c4
7141200: log some interesting information in ring buffers for crashes
never
parents:
2426
diff
changeset
|
43 char* buffer() { return _buf; } |
aa3d708d67c4
7141200: log some interesting information in ring buffers for crashes
never
parents:
2426
diff
changeset
|
44 int size() { return bufsz; } |
aa3d708d67c4
7141200: log some interesting information in ring buffers for crashes
never
parents:
2426
diff
changeset
|
45 |
aa3d708d67c4
7141200: log some interesting information in ring buffers for crashes
never
parents:
2426
diff
changeset
|
46 private: |
1490
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
47 FormatBuffer(const FormatBuffer &); // prevent copies |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
48 |
4872
aa3d708d67c4
7141200: log some interesting information in ring buffers for crashes
never
parents:
2426
diff
changeset
|
49 protected: |
1490
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
50 char _buf[bufsz]; |
4872
aa3d708d67c4
7141200: log some interesting information in ring buffers for crashes
never
parents:
2426
diff
changeset
|
51 |
aa3d708d67c4
7141200: log some interesting information in ring buffers for crashes
never
parents:
2426
diff
changeset
|
52 inline FormatBuffer(); |
1490
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
53 }; |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
54 |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
55 template <size_t bufsz> |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
56 FormatBuffer<bufsz>::FormatBuffer(const char * format, ...) { |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
57 va_list argp; |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
58 va_start(argp, format); |
2361 | 59 jio_vsnprintf(_buf, bufsz, format, argp); |
1490
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
60 va_end(argp); |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
61 } |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
62 |
2152 | 63 template <size_t bufsz> |
4872
aa3d708d67c4
7141200: log some interesting information in ring buffers for crashes
never
parents:
2426
diff
changeset
|
64 FormatBuffer<bufsz>::FormatBuffer() { |
aa3d708d67c4
7141200: log some interesting information in ring buffers for crashes
never
parents:
2426
diff
changeset
|
65 _buf[0] = '\0'; |
aa3d708d67c4
7141200: log some interesting information in ring buffers for crashes
never
parents:
2426
diff
changeset
|
66 } |
aa3d708d67c4
7141200: log some interesting information in ring buffers for crashes
never
parents:
2426
diff
changeset
|
67 |
aa3d708d67c4
7141200: log some interesting information in ring buffers for crashes
never
parents:
2426
diff
changeset
|
68 template <size_t bufsz> |
aa3d708d67c4
7141200: log some interesting information in ring buffers for crashes
never
parents:
2426
diff
changeset
|
69 void FormatBuffer<bufsz>::print(const char * format, ...) { |
aa3d708d67c4
7141200: log some interesting information in ring buffers for crashes
never
parents:
2426
diff
changeset
|
70 va_list argp; |
aa3d708d67c4
7141200: log some interesting information in ring buffers for crashes
never
parents:
2426
diff
changeset
|
71 va_start(argp, format); |
aa3d708d67c4
7141200: log some interesting information in ring buffers for crashes
never
parents:
2426
diff
changeset
|
72 jio_vsnprintf(_buf, bufsz, format, argp); |
aa3d708d67c4
7141200: log some interesting information in ring buffers for crashes
never
parents:
2426
diff
changeset
|
73 va_end(argp); |
aa3d708d67c4
7141200: log some interesting information in ring buffers for crashes
never
parents:
2426
diff
changeset
|
74 } |
aa3d708d67c4
7141200: log some interesting information in ring buffers for crashes
never
parents:
2426
diff
changeset
|
75 |
aa3d708d67c4
7141200: log some interesting information in ring buffers for crashes
never
parents:
2426
diff
changeset
|
76 template <size_t bufsz> |
aa3d708d67c4
7141200: log some interesting information in ring buffers for crashes
never
parents:
2426
diff
changeset
|
77 void FormatBuffer<bufsz>::printv(const char * format, va_list argp) { |
aa3d708d67c4
7141200: log some interesting information in ring buffers for crashes
never
parents:
2426
diff
changeset
|
78 jio_vsnprintf(_buf, bufsz, format, argp); |
aa3d708d67c4
7141200: log some interesting information in ring buffers for crashes
never
parents:
2426
diff
changeset
|
79 } |
aa3d708d67c4
7141200: log some interesting information in ring buffers for crashes
never
parents:
2426
diff
changeset
|
80 |
aa3d708d67c4
7141200: log some interesting information in ring buffers for crashes
never
parents:
2426
diff
changeset
|
81 template <size_t bufsz> |
2152 | 82 void FormatBuffer<bufsz>::append(const char* format, ...) { |
83 // Given that the constructor does a vsnprintf we can assume that | |
84 // _buf is already initialized. | |
85 size_t len = strlen(_buf); | |
86 char* buf_end = _buf + len; | |
87 | |
88 va_list argp; | |
89 va_start(argp, format); | |
2361 | 90 jio_vsnprintf(buf_end, bufsz - len, format, argp); |
2152 | 91 va_end(argp); |
92 } | |
93 | |
1490
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
94 // Used to format messages for assert(), guarantee(), fatal(), etc. |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
95 typedef FormatBuffer<> err_msg; |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
96 |
0 | 97 // assertions |
98 #ifdef ASSERT | |
1490
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
99 #ifndef USE_REPEATED_ASSERTS |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
100 #define assert(p, msg) \ |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
101 do { \ |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
102 if (!(p)) { \ |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
103 report_vm_error(__FILE__, __LINE__, "assert(" #p ") failed", msg); \ |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
104 BREAKPOINT; \ |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
105 } \ |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
106 } while (0) |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
107 #else // #ifndef USE_REPEATED_ASSERTS |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
108 #define assert(p, msg) |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
109 do { \ |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
110 for (int __i = 0; __i < AssertRepeat; __i++) { \ |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
111 if (!(p)) { \ |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
112 report_vm_error(__FILE__, __LINE__, "assert(" #p ") failed", msg); \ |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
113 BREAKPOINT; \ |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
114 } \ |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
115 } \ |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
116 } while (0) |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
117 #endif // #ifndef USE_REPEATED_ASSERTS |
0 | 118 |
119 // This version of assert is for use with checking return status from | |
120 // library calls that return actual error values eg. EINVAL, | |
121 // ENOMEM etc, rather than returning -1 and setting errno. | |
122 // When the status is not what is expected it is very useful to know | |
123 // what status was actually returned, so we pass the status variable as | |
124 // an extra arg and use strerror to convert it to a meaningful string | |
125 // like "Invalid argument", "out of memory" etc | |
1490
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
126 #define assert_status(p, status, msg) \ |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
127 do { \ |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
128 if (!(p)) { \ |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
129 report_vm_error(__FILE__, __LINE__, "assert(" #p ") failed", \ |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
130 err_msg("error %s(%d) %s", strerror(status), \ |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
131 status, msg)); \ |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
132 BREAKPOINT; \ |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
133 } \ |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
134 } while (0) |
0 | 135 |
136 // Do not assert this condition if there's already another error reported. | |
137 #define assert_if_no_error(cond,msg) assert((cond) || is_error_reported(), msg) | |
1490
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
138 #else // #ifdef ASSERT |
0 | 139 #define assert(p,msg) |
140 #define assert_status(p,status,msg) | |
141 #define assert_if_no_error(cond,msg) | |
1490
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
142 #endif // #ifdef ASSERT |
0 | 143 |
144 // guarantee is like assert except it's always executed -- use it for | |
1490
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
145 // cheap tests that catch errors that would otherwise be hard to find. |
0 | 146 // guarantee is also used for Verify options. |
1490
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
147 #define guarantee(p, msg) \ |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
148 do { \ |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
149 if (!(p)) { \ |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
150 report_vm_error(__FILE__, __LINE__, "guarantee(" #p ") failed", msg); \ |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
151 BREAKPOINT; \ |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
152 } \ |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
153 } while (0) |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
154 |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
155 #define fatal(msg) \ |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
156 do { \ |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
157 report_fatal(__FILE__, __LINE__, msg); \ |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
158 BREAKPOINT; \ |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
159 } while (0) |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
160 |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
161 // out of memory |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
162 #define vm_exit_out_of_memory(size, msg) \ |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
163 do { \ |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
164 report_vm_out_of_memory(__FILE__, __LINE__, size, msg); \ |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
165 BREAKPOINT; \ |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
166 } while (0) |
0 | 167 |
1490
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
168 #define ShouldNotCallThis() \ |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
169 do { \ |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
170 report_should_not_call(__FILE__, __LINE__); \ |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
171 BREAKPOINT; \ |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
172 } while (0) |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
173 |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
174 #define ShouldNotReachHere() \ |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
175 do { \ |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
176 report_should_not_reach_here(__FILE__, __LINE__); \ |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
177 BREAKPOINT; \ |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
178 } while (0) |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
179 |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
180 #define Unimplemented() \ |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
181 do { \ |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
182 report_unimplemented(__FILE__, __LINE__); \ |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
183 BREAKPOINT; \ |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
184 } while (0) |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
185 |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
186 #define Untested(msg) \ |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
187 do { \ |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
188 report_untested(__FILE__, __LINE__, msg); \ |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
189 BREAKPOINT; \ |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
190 } while (0); |
0 | 191 |
192 // error reporting helper functions | |
1490
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
193 void report_vm_error(const char* file, int line, const char* error_msg, |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
194 const char* detail_msg = NULL); |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
195 void report_fatal(const char* file, int line, const char* message); |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
196 void report_vm_out_of_memory(const char* file, int line, size_t size, |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
197 const char* message); |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
198 void report_should_not_call(const char* file, int line); |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
199 void report_should_not_reach_here(const char* file, int line); |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
200 void report_unimplemented(const char* file, int line); |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
201 void report_untested(const char* file, int line, const char* message); |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
202 |
0 | 203 void warning(const char* format, ...); |
204 | |
2177
3582bf76420e
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
2152
diff
changeset
|
205 // out of shared space reporting |
3582bf76420e
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
2152
diff
changeset
|
206 enum SharedSpaceType { |
3582bf76420e
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
2152
diff
changeset
|
207 SharedPermGen, |
3582bf76420e
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
2152
diff
changeset
|
208 SharedReadOnly, |
3582bf76420e
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
2152
diff
changeset
|
209 SharedReadWrite, |
3582bf76420e
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
2152
diff
changeset
|
210 SharedMiscData |
3582bf76420e
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
2152
diff
changeset
|
211 }; |
3582bf76420e
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
2152
diff
changeset
|
212 |
3582bf76420e
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
2152
diff
changeset
|
213 void report_out_of_shared_space(SharedSpaceType space_type); |
3582bf76420e
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
2152
diff
changeset
|
214 |
0 | 215 // out of memory reporting |
216 void report_java_out_of_memory(const char* message); | |
217 | |
218 // Support for self-destruct | |
219 bool is_error_reported(); | |
220 void set_error_reported(); | |
221 | |
1490
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
222 /* Test assert(), fatal(), guarantee(), etc. */ |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
223 NOT_PRODUCT(void test_error_handler(size_t test_num);) |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
0
diff
changeset
|
224 |
0 | 225 void pd_ps(frame f); |
226 void pd_obfuscate_location(char *buf, size_t buflen); | |
1972 | 227 |
228 #endif // SHARE_VM_UTILITIES_DEBUG_HPP |