2
|
1 |
/*
|
5506
|
2 |
* Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
|
2
|
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
|
5506
|
7 |
* published by the Free Software Foundation. Oracle designates this
|
2
|
8 |
* particular file as subject to the "Classpath" exception as provided
|
5506
|
9 |
* by Oracle in the LICENSE file that accompanied this code.
|
2
|
10 |
*
|
|
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that
|
|
15 |
* accompanied this code).
|
|
16 |
*
|
|
17 |
* You should have received a copy of the GNU General Public License version
|
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
20 |
*
|
5506
|
21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
22 |
* or visit www.oracle.com if you need additional information or have any
|
|
23 |
* questions.
|
2
|
24 |
*/
|
|
25 |
|
|
26 |
/* Error message and general message handling functions. */
|
|
27 |
|
|
28 |
/* NOTE: We assume that most strings passed around this library are
|
|
29 |
* UTF-8 (modified or standard) and not platform encoding.
|
|
30 |
* Before sending any strings to the "system" (e.g. OS system
|
|
31 |
* calls, or system input/output functions like fprintf) we need
|
|
32 |
* to make sure that the strings are transformed from UTF-8 to
|
|
33 |
* the platform encoding accepted by the system.
|
|
34 |
* UTF-8 and most encodings have simple ASCII or ISO-Latin
|
|
35 |
* characters as a subset, so in most cases the strings really
|
|
36 |
* don't need to be converted, but we don't know that easily.
|
|
37 |
* Parts of messages can be non-ASCII in some cases, so they may
|
|
38 |
* include classnames, methodnames, signatures, or other pieces
|
|
39 |
* that could contain non-ASCII characters, either from JNI or
|
|
40 |
* JVMTI (which both return modified UTF-8 strings).
|
|
41 |
* (It's possible that the platform encoding IS UTF-8, but we
|
|
42 |
* assume not, just to be safe).
|
|
43 |
*
|
|
44 |
*/
|
|
45 |
|
|
46 |
#include <stdarg.h>
|
|
47 |
#include <errno.h>
|
|
48 |
|
|
49 |
#include "util.h"
|
|
50 |
#include "proc_md.h"
|
|
51 |
|
|
52 |
/* Maximim length of a message */
|
|
53 |
#define MAX_MESSAGE_LEN MAXPATHLEN*2+512
|
|
54 |
|
|
55 |
/* Print message in platform encoding (assume all input is UTF-8 safe)
|
|
56 |
* NOTE: This function is at the lowest level of the call tree.
|
|
57 |
* Do not use the ERROR* macros here.
|
|
58 |
*/
|
|
59 |
static void
|
|
60 |
vprint_message(FILE *fp, const char *prefix, const char *suffix,
|
|
61 |
const char *format, va_list ap)
|
|
62 |
{
|
|
63 |
jbyte utf8buf[MAX_MESSAGE_LEN+1];
|
|
64 |
int len;
|
|
65 |
char pbuf[MAX_MESSAGE_LEN+1];
|
|
66 |
|
|
67 |
/* Fill buffer with single UTF-8 string */
|
|
68 |
(void)vsnprintf((char*)utf8buf, MAX_MESSAGE_LEN, format, ap);
|
|
69 |
utf8buf[MAX_MESSAGE_LEN] = 0;
|
|
70 |
len = (int)strlen((char*)utf8buf);
|
|
71 |
|
|
72 |
/* Convert to platform encoding (ignore errors, dangerous area) */
|
|
73 |
(void)(gdata->npt->utf8ToPlatform)(gdata->npt->utf,
|
|
74 |
utf8buf, len, pbuf, MAX_MESSAGE_LEN);
|
|
75 |
(void)fprintf(fp, "%s%s%s", prefix, pbuf, suffix);
|
|
76 |
}
|
|
77 |
|
|
78 |
/* Print message in platform encoding (assume all input is UTF-8 safe)
|
|
79 |
* NOTE: This function is at the lowest level of the call tree.
|
|
80 |
* Do not use the ERROR* macros here.
|
|
81 |
*/
|
|
82 |
void
|
|
83 |
print_message(FILE *fp, const char *prefix, const char *suffix,
|
|
84 |
const char *format, ...)
|
|
85 |
{
|
|
86 |
va_list ap;
|
|
87 |
|
|
88 |
va_start(ap, format);
|
|
89 |
vprint_message(fp, prefix, suffix, format, ap);
|
|
90 |
va_end(ap);
|
|
91 |
}
|
|
92 |
|
|
93 |
/* Generate error message */
|
|
94 |
void
|
|
95 |
error_message(const char *format, ...)
|
|
96 |
{
|
|
97 |
va_list ap;
|
|
98 |
|
|
99 |
va_start(ap, format);
|
|
100 |
vprint_message(stderr, "ERROR: ", "\n", format, ap);
|
|
101 |
va_end(ap);
|
|
102 |
if ( gdata->doerrorexit ) {
|
|
103 |
EXIT_ERROR(AGENT_ERROR_INTERNAL,"Requested errorexit=y exit()");
|
|
104 |
}
|
|
105 |
}
|
|
106 |
|
|
107 |
/* Print plain message to stdout. */
|
|
108 |
void
|
|
109 |
tty_message(const char *format, ...)
|
|
110 |
{
|
|
111 |
va_list ap;
|
|
112 |
|
|
113 |
va_start(ap, format);
|
|
114 |
vprint_message(stdout, "", "\n", format, ap);
|
|
115 |
va_end(ap);
|
|
116 |
(void)fflush(stdout);
|
|
117 |
}
|
|
118 |
|
|
119 |
/* Print assertion error message to stderr. */
|
|
120 |
void
|
|
121 |
jdiAssertionFailed(char *fileName, int lineNumber, char *msg)
|
|
122 |
{
|
|
123 |
LOG_MISC(("ASSERT FAILED: %s : %d - %s\n", fileName, lineNumber, msg));
|
|
124 |
print_message(stderr, "ASSERT FAILED: ", "\n",
|
|
125 |
"%s : %d - %s", fileName, lineNumber, msg);
|
|
126 |
if (gdata && gdata->assertFatal) {
|
|
127 |
EXIT_ERROR(AGENT_ERROR_INTERNAL,"Assertion Failed");
|
|
128 |
}
|
|
129 |
}
|
|
130 |
|
|
131 |
/* Macro for case on switch, returns string for name. */
|
|
132 |
#define CASE_RETURN_TEXT(name) case name: return #name;
|
|
133 |
|
|
134 |
/* Mapping of JVMTI errors to their name */
|
|
135 |
const char *
|
|
136 |
jvmtiErrorText(jvmtiError error)
|
|
137 |
{
|
|
138 |
switch (error) {
|
|
139 |
CASE_RETURN_TEXT(JVMTI_ERROR_NONE)
|
|
140 |
CASE_RETURN_TEXT(JVMTI_ERROR_INVALID_THREAD)
|
|
141 |
CASE_RETURN_TEXT(JVMTI_ERROR_INVALID_THREAD_GROUP)
|
|
142 |
CASE_RETURN_TEXT(JVMTI_ERROR_INVALID_PRIORITY)
|
|
143 |
CASE_RETURN_TEXT(JVMTI_ERROR_THREAD_NOT_SUSPENDED)
|
|
144 |
CASE_RETURN_TEXT(JVMTI_ERROR_THREAD_SUSPENDED)
|
|
145 |
CASE_RETURN_TEXT(JVMTI_ERROR_THREAD_NOT_ALIVE)
|
|
146 |
CASE_RETURN_TEXT(JVMTI_ERROR_INVALID_OBJECT)
|
|
147 |
CASE_RETURN_TEXT(JVMTI_ERROR_INVALID_CLASS)
|
|
148 |
CASE_RETURN_TEXT(JVMTI_ERROR_CLASS_NOT_PREPARED)
|
|
149 |
CASE_RETURN_TEXT(JVMTI_ERROR_INVALID_METHODID)
|
|
150 |
CASE_RETURN_TEXT(JVMTI_ERROR_INVALID_LOCATION)
|
|
151 |
CASE_RETURN_TEXT(JVMTI_ERROR_INVALID_FIELDID)
|
|
152 |
CASE_RETURN_TEXT(JVMTI_ERROR_NO_MORE_FRAMES)
|
|
153 |
CASE_RETURN_TEXT(JVMTI_ERROR_OPAQUE_FRAME)
|
|
154 |
CASE_RETURN_TEXT(JVMTI_ERROR_TYPE_MISMATCH)
|
|
155 |
CASE_RETURN_TEXT(JVMTI_ERROR_INVALID_SLOT)
|
|
156 |
CASE_RETURN_TEXT(JVMTI_ERROR_DUPLICATE)
|
|
157 |
CASE_RETURN_TEXT(JVMTI_ERROR_NOT_FOUND)
|
|
158 |
CASE_RETURN_TEXT(JVMTI_ERROR_INVALID_MONITOR)
|
|
159 |
CASE_RETURN_TEXT(JVMTI_ERROR_NOT_MONITOR_OWNER)
|
|
160 |
CASE_RETURN_TEXT(JVMTI_ERROR_INTERRUPT)
|
|
161 |
CASE_RETURN_TEXT(JVMTI_ERROR_INVALID_CLASS_FORMAT)
|
|
162 |
CASE_RETURN_TEXT(JVMTI_ERROR_CIRCULAR_CLASS_DEFINITION)
|
|
163 |
CASE_RETURN_TEXT(JVMTI_ERROR_FAILS_VERIFICATION)
|
|
164 |
CASE_RETURN_TEXT(JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_ADDED)
|
|
165 |
CASE_RETURN_TEXT(JVMTI_ERROR_UNSUPPORTED_REDEFINITION_SCHEMA_CHANGED)
|
|
166 |
CASE_RETURN_TEXT(JVMTI_ERROR_INVALID_TYPESTATE)
|
|
167 |
CASE_RETURN_TEXT(JVMTI_ERROR_UNSUPPORTED_REDEFINITION_HIERARCHY_CHANGED)
|
|
168 |
CASE_RETURN_TEXT(JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_DELETED)
|
|
169 |
CASE_RETURN_TEXT(JVMTI_ERROR_UNSUPPORTED_VERSION)
|
|
170 |
CASE_RETURN_TEXT(JVMTI_ERROR_NAMES_DONT_MATCH)
|
|
171 |
CASE_RETURN_TEXT(JVMTI_ERROR_UNSUPPORTED_REDEFINITION_CLASS_MODIFIERS_CHANGED)
|
|
172 |
CASE_RETURN_TEXT(JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_MODIFIERS_CHANGED)
|
|
173 |
CASE_RETURN_TEXT(JVMTI_ERROR_NOT_AVAILABLE)
|
|
174 |
CASE_RETURN_TEXT(JVMTI_ERROR_MUST_POSSESS_CAPABILITY)
|
|
175 |
CASE_RETURN_TEXT(JVMTI_ERROR_NULL_POINTER)
|
|
176 |
CASE_RETURN_TEXT(JVMTI_ERROR_ABSENT_INFORMATION)
|
|
177 |
CASE_RETURN_TEXT(JVMTI_ERROR_INVALID_EVENT_TYPE)
|
|
178 |
CASE_RETURN_TEXT(JVMTI_ERROR_ILLEGAL_ARGUMENT)
|
|
179 |
CASE_RETURN_TEXT(JVMTI_ERROR_OUT_OF_MEMORY)
|
|
180 |
CASE_RETURN_TEXT(JVMTI_ERROR_ACCESS_DENIED)
|
|
181 |
CASE_RETURN_TEXT(JVMTI_ERROR_WRONG_PHASE)
|
|
182 |
CASE_RETURN_TEXT(JVMTI_ERROR_INTERNAL)
|
|
183 |
CASE_RETURN_TEXT(JVMTI_ERROR_UNATTACHED_THREAD)
|
|
184 |
CASE_RETURN_TEXT(JVMTI_ERROR_INVALID_ENVIRONMENT)
|
|
185 |
|
|
186 |
CASE_RETURN_TEXT(AGENT_ERROR_INTERNAL)
|
|
187 |
CASE_RETURN_TEXT(AGENT_ERROR_VM_DEAD)
|
|
188 |
CASE_RETURN_TEXT(AGENT_ERROR_NO_JNI_ENV)
|
|
189 |
CASE_RETURN_TEXT(AGENT_ERROR_JNI_EXCEPTION)
|
|
190 |
CASE_RETURN_TEXT(AGENT_ERROR_JVMTI_INTERNAL)
|
|
191 |
CASE_RETURN_TEXT(AGENT_ERROR_JDWP_INTERNAL)
|
|
192 |
CASE_RETURN_TEXT(AGENT_ERROR_NOT_CURRENT_FRAME)
|
|
193 |
CASE_RETURN_TEXT(AGENT_ERROR_OUT_OF_MEMORY)
|
|
194 |
CASE_RETURN_TEXT(AGENT_ERROR_INVALID_TAG)
|
|
195 |
CASE_RETURN_TEXT(AGENT_ERROR_ALREADY_INVOKING)
|
|
196 |
CASE_RETURN_TEXT(AGENT_ERROR_INVALID_INDEX)
|
|
197 |
CASE_RETURN_TEXT(AGENT_ERROR_INVALID_LENGTH)
|
|
198 |
CASE_RETURN_TEXT(AGENT_ERROR_INVALID_STRING)
|
|
199 |
CASE_RETURN_TEXT(AGENT_ERROR_INVALID_CLASS_LOADER)
|
|
200 |
CASE_RETURN_TEXT(AGENT_ERROR_INVALID_ARRAY)
|
|
201 |
CASE_RETURN_TEXT(AGENT_ERROR_TRANSPORT_LOAD)
|
|
202 |
CASE_RETURN_TEXT(AGENT_ERROR_TRANSPORT_INIT)
|
|
203 |
CASE_RETURN_TEXT(AGENT_ERROR_NATIVE_METHOD)
|
|
204 |
CASE_RETURN_TEXT(AGENT_ERROR_INVALID_COUNT)
|
|
205 |
CASE_RETURN_TEXT(AGENT_ERROR_INVALID_FRAMEID)
|
|
206 |
CASE_RETURN_TEXT(AGENT_ERROR_NULL_POINTER)
|
|
207 |
CASE_RETURN_TEXT(AGENT_ERROR_ILLEGAL_ARGUMENT)
|
|
208 |
CASE_RETURN_TEXT(AGENT_ERROR_INVALID_THREAD)
|
|
209 |
CASE_RETURN_TEXT(AGENT_ERROR_INVALID_EVENT_TYPE)
|
|
210 |
CASE_RETURN_TEXT(AGENT_ERROR_INVALID_OBJECT)
|
|
211 |
CASE_RETURN_TEXT(AGENT_ERROR_NO_MORE_FRAMES)
|
|
212 |
|
|
213 |
default: return "ERROR_unknown";
|
|
214 |
}
|
|
215 |
}
|
|
216 |
|
|
217 |
const char *
|
|
218 |
eventText(int i)
|
|
219 |
{
|
|
220 |
switch ( i ) {
|
|
221 |
CASE_RETURN_TEXT(EI_SINGLE_STEP)
|
|
222 |
CASE_RETURN_TEXT(EI_BREAKPOINT)
|
|
223 |
CASE_RETURN_TEXT(EI_FRAME_POP)
|
|
224 |
CASE_RETURN_TEXT(EI_EXCEPTION)
|
|
225 |
CASE_RETURN_TEXT(EI_THREAD_START)
|
|
226 |
CASE_RETURN_TEXT(EI_THREAD_END)
|
|
227 |
CASE_RETURN_TEXT(EI_CLASS_PREPARE)
|
|
228 |
CASE_RETURN_TEXT(EI_CLASS_LOAD)
|
|
229 |
CASE_RETURN_TEXT(EI_FIELD_ACCESS)
|
|
230 |
CASE_RETURN_TEXT(EI_FIELD_MODIFICATION)
|
|
231 |
CASE_RETURN_TEXT(EI_EXCEPTION_CATCH)
|
|
232 |
CASE_RETURN_TEXT(EI_METHOD_ENTRY)
|
|
233 |
CASE_RETURN_TEXT(EI_METHOD_EXIT)
|
|
234 |
CASE_RETURN_TEXT(EI_VM_INIT)
|
|
235 |
CASE_RETURN_TEXT(EI_VM_DEATH)
|
|
236 |
CASE_RETURN_TEXT(EI_GC_FINISH)
|
|
237 |
default: return "EVENT_unknown";
|
|
238 |
}
|
|
239 |
}
|
|
240 |
|
|
241 |
/* Macro for case on switch, returns string for name. */
|
|
242 |
#define CASE_RETURN_JDWP_ERROR_TEXT(name) case JDWP_ERROR(name): return #name;
|
|
243 |
|
|
244 |
const char *
|
|
245 |
jdwpErrorText(jdwpError serror)
|
|
246 |
{
|
|
247 |
switch ( serror ) {
|
|
248 |
CASE_RETURN_JDWP_ERROR_TEXT(NONE)
|
|
249 |
CASE_RETURN_JDWP_ERROR_TEXT(INVALID_THREAD)
|
|
250 |
CASE_RETURN_JDWP_ERROR_TEXT(INVALID_THREAD_GROUP)
|
|
251 |
CASE_RETURN_JDWP_ERROR_TEXT(INVALID_PRIORITY)
|
|
252 |
CASE_RETURN_JDWP_ERROR_TEXT(THREAD_NOT_SUSPENDED)
|
|
253 |
CASE_RETURN_JDWP_ERROR_TEXT(THREAD_SUSPENDED)
|
|
254 |
CASE_RETURN_JDWP_ERROR_TEXT(INVALID_OBJECT)
|
|
255 |
CASE_RETURN_JDWP_ERROR_TEXT(INVALID_CLASS)
|
|
256 |
CASE_RETURN_JDWP_ERROR_TEXT(CLASS_NOT_PREPARED)
|
|
257 |
CASE_RETURN_JDWP_ERROR_TEXT(INVALID_METHODID)
|
|
258 |
CASE_RETURN_JDWP_ERROR_TEXT(INVALID_LOCATION)
|
|
259 |
CASE_RETURN_JDWP_ERROR_TEXT(INVALID_FIELDID)
|
|
260 |
CASE_RETURN_JDWP_ERROR_TEXT(INVALID_FRAMEID)
|
|
261 |
CASE_RETURN_JDWP_ERROR_TEXT(NO_MORE_FRAMES)
|
|
262 |
CASE_RETURN_JDWP_ERROR_TEXT(OPAQUE_FRAME)
|
|
263 |
CASE_RETURN_JDWP_ERROR_TEXT(NOT_CURRENT_FRAME)
|
|
264 |
CASE_RETURN_JDWP_ERROR_TEXT(TYPE_MISMATCH)
|
|
265 |
CASE_RETURN_JDWP_ERROR_TEXT(INVALID_SLOT)
|
|
266 |
CASE_RETURN_JDWP_ERROR_TEXT(DUPLICATE)
|
|
267 |
CASE_RETURN_JDWP_ERROR_TEXT(NOT_FOUND)
|
|
268 |
CASE_RETURN_JDWP_ERROR_TEXT(INVALID_MONITOR)
|
|
269 |
CASE_RETURN_JDWP_ERROR_TEXT(NOT_MONITOR_OWNER)
|
|
270 |
CASE_RETURN_JDWP_ERROR_TEXT(INTERRUPT)
|
|
271 |
CASE_RETURN_JDWP_ERROR_TEXT(INVALID_CLASS_FORMAT)
|
|
272 |
CASE_RETURN_JDWP_ERROR_TEXT(CIRCULAR_CLASS_DEFINITION)
|
|
273 |
CASE_RETURN_JDWP_ERROR_TEXT(FAILS_VERIFICATION)
|
|
274 |
CASE_RETURN_JDWP_ERROR_TEXT(ADD_METHOD_NOT_IMPLEMENTED)
|
|
275 |
CASE_RETURN_JDWP_ERROR_TEXT(SCHEMA_CHANGE_NOT_IMPLEMENTED)
|
|
276 |
CASE_RETURN_JDWP_ERROR_TEXT(INVALID_TYPESTATE)
|
|
277 |
CASE_RETURN_JDWP_ERROR_TEXT(HIERARCHY_CHANGE_NOT_IMPLEMENTED)
|
|
278 |
CASE_RETURN_JDWP_ERROR_TEXT(DELETE_METHOD_NOT_IMPLEMENTED)
|
|
279 |
CASE_RETURN_JDWP_ERROR_TEXT(UNSUPPORTED_VERSION)
|
|
280 |
CASE_RETURN_JDWP_ERROR_TEXT(NAMES_DONT_MATCH)
|
|
281 |
CASE_RETURN_JDWP_ERROR_TEXT(CLASS_MODIFIERS_CHANGE_NOT_IMPLEMENTED)
|
|
282 |
CASE_RETURN_JDWP_ERROR_TEXT(METHOD_MODIFIERS_CHANGE_NOT_IMPLEMENTED)
|
|
283 |
CASE_RETURN_JDWP_ERROR_TEXT(NOT_IMPLEMENTED)
|
|
284 |
CASE_RETURN_JDWP_ERROR_TEXT(NULL_POINTER)
|
|
285 |
CASE_RETURN_JDWP_ERROR_TEXT(ABSENT_INFORMATION)
|
|
286 |
CASE_RETURN_JDWP_ERROR_TEXT(INVALID_EVENT_TYPE)
|
|
287 |
CASE_RETURN_JDWP_ERROR_TEXT(ILLEGAL_ARGUMENT)
|
|
288 |
CASE_RETURN_JDWP_ERROR_TEXT(OUT_OF_MEMORY)
|
|
289 |
CASE_RETURN_JDWP_ERROR_TEXT(ACCESS_DENIED)
|
|
290 |
CASE_RETURN_JDWP_ERROR_TEXT(VM_DEAD)
|
|
291 |
CASE_RETURN_JDWP_ERROR_TEXT(INTERNAL)
|
|
292 |
CASE_RETURN_JDWP_ERROR_TEXT(UNATTACHED_THREAD)
|
|
293 |
CASE_RETURN_JDWP_ERROR_TEXT(INVALID_TAG)
|
|
294 |
CASE_RETURN_JDWP_ERROR_TEXT(ALREADY_INVOKING)
|
|
295 |
CASE_RETURN_JDWP_ERROR_TEXT(INVALID_INDEX)
|
|
296 |
CASE_RETURN_JDWP_ERROR_TEXT(INVALID_LENGTH)
|
|
297 |
CASE_RETURN_JDWP_ERROR_TEXT(INVALID_STRING)
|
|
298 |
CASE_RETURN_JDWP_ERROR_TEXT(INVALID_CLASS_LOADER)
|
|
299 |
CASE_RETURN_JDWP_ERROR_TEXT(INVALID_ARRAY)
|
|
300 |
CASE_RETURN_JDWP_ERROR_TEXT(TRANSPORT_LOAD)
|
|
301 |
CASE_RETURN_JDWP_ERROR_TEXT(TRANSPORT_INIT)
|
|
302 |
CASE_RETURN_JDWP_ERROR_TEXT(NATIVE_METHOD)
|
|
303 |
CASE_RETURN_JDWP_ERROR_TEXT(INVALID_COUNT)
|
|
304 |
default: return "JDWP_ERROR_unknown";
|
|
305 |
}
|
|
306 |
}
|
|
307 |
|
|
308 |
static int p = 1;
|
|
309 |
|
|
310 |
void
|
|
311 |
do_pause(void)
|
|
312 |
{
|
|
313 |
THREAD_T tid = GET_THREAD_ID();
|
|
314 |
PID_T pid = GETPID();
|
|
315 |
int timeleft = 600; /* 10 minutes max */
|
|
316 |
int interval = 10; /* 10 second message check */
|
|
317 |
|
|
318 |
/*LINTED*/
|
|
319 |
tty_message("DEBUGGING: JDWP pause for PID %d, THREAD %d (0x%x)",
|
|
320 |
/*LINTED*/
|
|
321 |
(int)(intptr_t)pid, (int)(intptr_t)tid, (int)(intptr_t)tid);
|
|
322 |
while ( p && timeleft > 0 ) {
|
|
323 |
(void)sleep(interval); /* 'assign p = 0;' to get out of loop */
|
|
324 |
timeleft -= interval;
|
|
325 |
}
|
|
326 |
if ( timeleft <= 0 ) {
|
|
327 |
tty_message("DEBUGGING: JDWP pause got tired of waiting and gave up.");
|
|
328 |
}
|
|
329 |
}
|