Check-in [e62dad00a3]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Remove DebugAccess.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:e62dad00a30ecaa854a4d875c1dbc1140c3f22f5
User & Date: stephanie.gawroriski 2019-06-16 23:26:16
Context
2019-06-17
01:08
Add support for call traces in SpringCoat. check-in: 339bb6b0b3 user: stephanie.gawroriski tags: trunk
2019-06-16
23:26
Remove DebugAccess. check-in: e62dad00a3 user: stephanie.gawroriski tags: trunk
23:25
Map fatal TODO to System calls. check-in: 138b9c48ff user: stephanie.gawroriski tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Deleted bldt/javase/libs/javase-runtime/cc/squirreljme/runtime/cldc/asm/DebugAccess.java.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
//     Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package cc.squirreljme.runtime.cldc.asm;

import cc.squirreljme.runtime.cldc.debug.CallTraceElement;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;

/**
 * This is used to provide debug access to the virtual machine and to do
 * some unsafe things. This file is for the Java SE bootstrap since it does not
 * know what SquirrelJME does in its library.
 *
 * @since 2018/09/29
 */
@Deprecated
public final class DebugAccess
{
	/** The elements per trace. */
	public static final int TRACE_COUNT =
		11;
	
	/** Lock. */
	private static final Object _LOCK =
		new Object();
	
	/** Long to string map. */
	private static final Map<Long, String> _LONG_TO_STRING =
		new HashMap<>();
	
	/** String to long map. */
	private static final Map<String, Long> _STRING_TO_LONG =
		new HashMap<>();
	
	/** The next long to choose. */
	private static long _nextlong;
	
	/**
	 * Not used.
	 *
	 * @since 2018/09/16
	 */
	private DebugAccess()
	{
	}
	
	/**
	 * Reports that the given raw trace information using some given means,
	 * this is to detect early TODOs before there is any real code that exists.
	 * Since the code might end up infinite looping while constantly hitting
	 * TODOs, this is a means it might not be reported properly. This call
	 * should be fatal and terminate the machine.
	 *
	 * @param __rct The raw trace code.
	 * @since 2018/09/19
	 */
	@Deprecated
	public static final void fatalTodoReport(int[] __rct)
	{
		new Error(Arrays.toString(__rct)).printStackTrace(System.err);
		System.exit(-1);
	}
	
	/**
	 * Returns the raw call trace without any objects.
	 *
	 * The values are in groups of longs for each individual element, dual
	 * elements are in {@code [high, low]} order:
	 *  0,1. Pointer to string, specifying the class.
	 *  2,3. Pointer to string, specifying the method.
	 *  4,5. Pointer to string, specifying the method descriptor.
	 *  6,7. The address of the program counter if it is possible to get.
	 *  8,9. Pointer to string, specifying the file if it is possible to get.
	 *  10 . The line of code in the file this is in, if it is possible to get.
	 *
	 * If any value is unknown then {@code -1} will be used as the value.
	 *
	 * @return The raw call trace in pointer and value format.
	 * @since 2018/09/16
	 */
	@Deprecated
	public static final int[] rawCallTrace()
	{
		// Get origin trace
		StackTraceElement[] from = new Throwable().getStackTrace();
		int n = from.length;
		
		// Convert to call trace elements
		CallTraceElement[] elems = new CallTraceElement[n];
		for (int i = 0; i < n; i++)
			elems[i] = DebugAccess.__stackJavaToDebug(from[i]);
		
		// Snip top stack entries off accordingly
		int elemlen = elems.length,
			baseoff = 0;
		while (baseoff < elemlen)
		{
			CallTraceElement e = elems[baseoff];
			if (e == null)
				continue;
			
			String clname = e.className();
			if (clname != null &&
				(clname.startsWith("cc/squirreljme/runtime/cldc/asm/") ||
				clname.startsWith("cc.squirreljme.runtime.cldc.asm.")))
				baseoff++;
			else
				break;
		}
		
		// Convert to raw entries
		int[] rv = new int[TRACE_COUNT * (elemlen - baseoff)];
		for (int i = baseoff, o = 0, dn = elemlen; i < dn;
			i++, o += TRACE_COUNT)
		{
			CallTraceElement e = elems[i];
			
			DebugAccess.__longToInt(o + 0, rv,
				DebugAccess.__unresolveString(
					DebugAccess.__normalize(e.className())));
			DebugAccess.__longToInt(o + 2, rv,
				DebugAccess.__unresolveString(e.methodName()));
			DebugAccess.__longToInt(o + 4, rv,
				DebugAccess.__unresolveString(e.methodDescriptor()));
			DebugAccess.__longToInt(o + 6, rv,
				e.address());
			DebugAccess.__longToInt(o + 8, rv,
				DebugAccess.__unresolveString(e.file()));
			rv[o + 10] = e.line();
		}
		
		return rv;
	}
	
	/**
	 * This translates a raw call trace into a wrapped call trace to make it
	 * simpler to easier to parse.
	 *
	 * @param __v The input raw call trace.
	 * @return The translated call trace.
	 * @throws NullPointerException On null arguments.
	 * @since 2018/09/16
	 */
	@Deprecated
	public static final CallTraceElement[] resolveRawCallTrace(int[] __v)
		throws NullPointerException
	{
		if (__v == null)
			throw new NullPointerException("NARG");
		
		int rawlen = __v.length,
			numframes = rawlen / TRACE_COUNT;
		
		CallTraceElement[] rv = new CallTraceElement[numframes];
		
		// Convert frames
		for (int o = 0, i = 0; o < numframes; o++, i += TRACE_COUNT)
			rv[o] = new CallTraceElement(
				DebugAccess.resolveString(DebugAccess.__intToLong(i + 0, __v)),
				DebugAccess.resolveString(DebugAccess.__intToLong(i + 2, __v)),
				DebugAccess.resolveString(DebugAccess.__intToLong(i + 4, __v)),
				DebugAccess.__intToLong(i + 6, __v),
				DebugAccess.resolveString(DebugAccess.__intToLong(i + 8, __v)),
				__v[i + 10]);
		
		return rv;
	}
	
	/**
	 * Resolves the given string pointer.
	 *
	 * @param __p The pointer.
	 * @return The string at the given pointer or {@code null} if it has no
	 * resolution.
	 * @since 2018/09/29
	 */
	@Deprecated
	public static final String resolveString(long __p)
	{
		if (__p == -1L)
			return null;
		
		synchronized (DebugAccess._LOCK)
		{
			return DebugAccess._LONG_TO_STRING.get(__p);
		}
	}
	
	/**
	 * Unresolves the string to the given pointer.
	 *
	 * @param __s The string to resolve.
	 * @return The pointer to the string, or {@code -1} if it is not valid.
	 * @since 2018/09/29
	 */
	@Deprecated
	public static final long unresolveString(String __s)
	{
		return DebugAccess.__unresolveString(__s);
	}
	
	/**
	 * Combines an integer to long.
	 *
	 * @param __dx The index.
	 * @param __v The input integers.
	 * @return The resulting long.
	 * @since 2018/09/29
	 */
	@Deprecated
	static final long __intToLong(int __dx, int[] __v)
		throws NullPointerException
	{
		if (__v == null)
			throw new NullPointerException("NARG");
		
		return (((long)__v[__dx]) << 32L) |
			(((long)__v[__dx + 1]) & 0xFFFFFFFFL);
	}
	
	/**
	 * Splits long to integers.
	 *
	 * @param __dx The index.
	 * @param __v The output integers.
	 * @param __l The input long.
	 * @since 2018/09/29
	 */
	@Deprecated
	static final void __longToInt(int __dx, int[] __v, long __l)
	{
		__v[__dx] = (int)(__l >>> 32);
		__v[__dx + 1] = (int)__l;
	}
	
	/**
	 * Normalize class name string.
	 *
	 * @param __s The input string.
	 * @return The normalized string.
	 * @since 2018/09/29
	 */
	@Deprecated
	static final String __normalize(String __s)
	{
		if (__s == null)
			return null;
		
		return __s.replace('.', '/');
	}
	
	/**
	 * Converts a debug call trace element to a stack trace element.
	 *
	 * @param __e The input element.
	 * @return The converted element.
	 * @throws NullPointerException On null arguments.
	 * @since 2018/03/15
	 */
	@Deprecated
	static StackTraceElement __stackDebugToJava(CallTraceElement __e)
		throws NullPointerException
	{
		if (__e == null)
			throw new NullPointerException("NARG");
		
		String clname = __e.className();
		if (clname != null)
			clname = clname.replace('/', '.');
		
		return new StackTraceElement(clname, __e.methodName(),
			__e.file(), __e.line());
	}
	
	/**
	 * Converts a stack trace element to a debug call trace element.
	 *
	 * @param __e The input element.
	 * @return The converted element.
	 * @throws NullPointerException On null arguments.
	 * @since 2018/03/15
	 */
	@Deprecated
	static CallTraceElement __stackJavaToDebug(StackTraceElement __e)
		throws NullPointerException
	{
		if (__e == null)
			throw new NullPointerException("NARG");
		
		String clname = __e.getClassName();
		if (clname != null)
			clname = clname.replace('.', '/');
		
		return new CallTraceElement(clname, __e.getMethodName(),
			null, -1, __e.getFileName(), __e.getLineNumber());
	}
	
	/**
	 * Unresolves the given string.
	 *
	 * @param __s The string to unresolve.
	 * @return The pointer to the string.
	 * @since 2018/09/29
	 */
	@Deprecated
	static long __unresolveString(String __s)
	{
		if (__s == null)
			return -1L;
		
		synchronized (DebugAccess._LOCK)
		{
			Long rv = DebugAccess._STRING_TO_LONG.get(__s);
			if (rv != null)
				return rv.longValue();
			
			Long next = Long.valueOf(++DebugAccess._nextlong);
			DebugAccess._STRING_TO_LONG.put(__s, next);
			DebugAccess._LONG_TO_STRING.put(next, __s);
			
			return next;
		}
	}
}

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<






























































































































































































































































































































































































































































































































































































































































































Deleted runt/apis/cldc-compact/cc/squirreljme/runtime/cldc/asm/DebugAccess.java.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
//     Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package cc.squirreljme.runtime.cldc.asm;

import cc.squirreljme.runtime.cldc.annotation.Api;
import cc.squirreljme.runtime.cldc.debug.CallTraceElement;
import cc.squirreljme.runtime.cldc.lang.ApiLevel;

/**
 * This is used to provide debug access to the virtual machine and to do
 * some unsafe things.
 *
 * @since 2018/09/16
 */
@Deprecated
public final class DebugAccess
{
	/** The elements per trace. */
	public static final int TRACE_COUNT =
		11;
	
	/**
	 * Not used.
	 *
	 * @since 2018/09/16
	 */
	private DebugAccess()
	{
	}
	
	/**
	 * Reports that the given raw trace information using some given means,
	 * this is to detect early TODOs before there is any real code that exists.
	 * Since the code might end up infinite looping while constantly hitting
	 * TODOs, this is a means it might not be reported properly. This call
	 * should be fatal and terminate the machine.
	 *
	 * @param __rct The raw trace code.
	 * @since 2018/09/19
	 */
	@Api(ApiLevel.LEVEL_SQUIRRELJME_0_2_0_20181225)
	@Deprecated
	public static final native void fatalTodoReport(int[] __rct);
	
	/**
	 * Returns the raw call trace without any objects.
	 *
	 * The values are in groups of longs for each individual element, dual
	 * elements are in {@code [high, low]} order:
	 *  0,1. Pointer to string, specifying the class.
	 *  2,3. Pointer to string, specifying the method.
	 *  4,5. Pointer to string, specifying the method descriptor.
	 *  6,7. The address of the program counter if it is possible to get.
	 *  8,9. Pointer to string, specifying the file if it is possible to get.
	 *  10 . The line of code in the file this is in, if it is possible to get.
	 *
	 * If any value is unknown then {@code -1} will be used as the value.
	 *
	 * @return The raw call trace in pointer and value format.
	 * @since 2018/09/16
	 */
	@Api(ApiLevel.LEVEL_SQUIRRELJME_0_2_0_20181225)
	@Deprecated
	public static final native int[] rawCallTrace();
	
	/**
	 * Resolves the given string pointer.
	 *
	 * @param __p The pointer.
	 * @return The string at the given pointer or {@code null} if it has no
	 * resolution.
	 * @since 2018/09/29
	 */
	@Api(ApiLevel.LEVEL_SQUIRRELJME_0_2_0_20181225)
	@Deprecated
	public static final native String resolveString(long __p);
	
	/**
	 * Unresolves the string to the given pointer.
	 *
	 * @param __s The string to resolve.
	 * @return The pointer to the string, or {@code -1} if it is not valid.
	 * @since 2018/09/29
	 */
	@Api(ApiLevel.LEVEL_SQUIRRELJME_0_2_0_20181225)
	@Deprecated
	public static final native long unresolveString(String __s);
	
	/**
	 * Combines an integer to long.
	 *
	 * @param __dx The index.
	 * @param __v The input integers.
	 * @return The resulting long.
	 * @since 2018/09/29
	 */
	@Deprecated
	public static final long intToLong(int __dx, int[] __v)
		throws NullPointerException
	{
		if (__v == null)
			throw new NullPointerException("NARG");
		
		return (((long)__v[__dx]) << 32L) |
			(((long)__v[__dx + 1]) & 0xFFFFFFFFL);
	}
	
	/**
	 * This translates a raw call trace into a wrapped call trace to make it
	 * simpler to easier to parse.
	 *
	 * @param __v The input raw call trace.
	 * @return The translated call trace.
	 * @throws NullPointerException On null arguments.
	 * @since 2018/09/16
	 */
	@Deprecated
	public static final CallTraceElement[] resolveRawCallTrace(int[] __v)
		throws NullPointerException
	{
		if (__v == null)
			throw new NullPointerException("NARG");
		
		int rawlen = __v.length,
			numframes = rawlen / TRACE_COUNT;
		
		CallTraceElement[] rv = new CallTraceElement[numframes];
		
		// Convert frames
		for (int o = 0, i = 0; o < numframes; o++, i += TRACE_COUNT)
			rv[o] = new CallTraceElement(
				DebugAccess.resolveString(DebugAccess.intToLong(i + 0, __v)),
				DebugAccess.resolveString(DebugAccess.intToLong(i + 2, __v)),
				DebugAccess.resolveString(DebugAccess.intToLong(i + 4, __v)),
				DebugAccess.intToLong(i + 6, __v),
				DebugAccess.resolveString(DebugAccess.intToLong(i + 8, __v)),
				__v[i + 10]);
		
		return rv;
	}
}

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<












































































































































































































































































































Deleted runt/libs/common-vm-stubs/cc/squirreljme/runtime/cldc/asm/DebugAccess.java.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
//     Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package cc.squirreljme.runtime.cldc.asm;

import cc.squirreljme.runtime.cldc.debug.CallTraceElement;

/**
 * This is used to provide debug access to the virtual machine and to do
 * some unsafe things.
 *
 * @since 2018/09/16
 */
public final class DebugAccess
{
	/** The elements per trace. */
	public static final int TRACE_COUNT =
		11;
	
	/**
	 * Not used.
	 *
	 * @since 2018/09/16
	 */
	private DebugAccess()
	{
	}
	
	/**
	 * Reports that the given raw trace information using some given means,
	 * this is to detect early TODOs before there is any real code that exists.
	 * Since the code might end up infinite looping while constantly hitting
	 * TODOs, this is a means it might not be reported properly. This call
	 * should be fatal and terminate the machine.
	 *
	 * @param __rct The raw trace code.
	 * @since 2018/09/19
	 */
	public static final void fatalTodoReport(int[] __rct)
	{
		System.err.print("[");
		for (int i = 0, n = __rct.length; i < n; i++)
			System.err.printf("%08x ", __rct[i]);
		System.err.println("]");
		System.exit(127);
	}
	
	/**
	 * Returns the raw call trace without any objects.
	 *
	 * The values are in groups of longs for each individual element, dual
	 * elements are in {@code [high, low]} order:
	 *  0,1. Pointer to string, specifying the class.
	 *  2,3. Pointer to string, specifying the method.
	 *  4,5. Pointer to string, specifying the method descriptor.
	 *  6,7. The address of the program counter if it is possible to get.
	 *  8,9. Pointer to string, specifying the file if it is possible to get.
	 *  10 . The line of code in the file this is in, if it is possible to get.
	 *
	 * If any value is unknown then {@code -1} will be used as the value.
	 *
	 * @return The raw call trace in pointer and value format.
	 * @since 2018/09/16
	 */
	public static final int[] rawCallTrace()
	{
		return new int[0];
	}
	
	/**
	 * Resolves the given string pointer.
	 *
	 * @param __p The pointer.
	 * @return The string at the given pointer or {@code null} if it has no
	 * resolution.
	 * @since 2018/09/29
	 */
	public static final String resolveString(long __p)
	{
		return null;
	}
	
	/**
	 * Unresolves the string to the given pointer.
	 *
	 * @param __s The string to resolve.
	 * @return The pointer to the string, or {@code -1} if it is not valid.
	 * @since 2018/09/29
	 */
	public static final long unresolveString(String __s)
	{
		return -1;
	}
	
	/**
	 * Combines an integer to long.
	 *
	 * @param __dx The index.
	 * @param __v The input integers.
	 * @return The resulting long.
	 * @since 2018/09/29
	 */
	public static final long intToLong(int __dx, int[] __v)
		throws NullPointerException
	{
		if (__v == null)
			throw new NullPointerException("NARG");
		
		return (((long)__v[__dx]) << 32L) |
			(((long)__v[__dx + 1]) & 0xFFFFFFFFL);
	}
	
	/**
	 * This translates a raw call trace into a wrapped call trace to make it
	 * simpler to easier to parse.
	 *
	 * @param __v The input raw call trace.
	 * @return The translated call trace.
	 * @throws NullPointerException On null arguments.
	 * @since 2018/09/16
	 */
	public static final CallTraceElement[] resolveRawCallTrace(int[] __v)
		throws NullPointerException
	{
		if (__v == null)
			throw new NullPointerException("NARG");
		 
		int rawlen = __v.length,
			numframes = rawlen / TRACE_COUNT;
		
		CallTraceElement[] rv = new CallTraceElement[numframes];
		
		// Convert frames
		for (int o = 0, i = 0; o < numframes; o++, i += TRACE_COUNT)
			rv[o] = new CallTraceElement(
				DebugAccess.resolveString(DebugAccess.intToLong(i + 0, __v)),
				DebugAccess.resolveString(DebugAccess.intToLong(i + 2, __v)),
				DebugAccess.resolveString(DebugAccess.intToLong(i + 4, __v)),
				DebugAccess.intToLong(i + 6, __v),
				DebugAccess.resolveString(DebugAccess.intToLong(i + 8, __v)),
				__v[i + 10]);
		
		return rv;
	}
}

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<