Check-in [138b9c48ff]

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

Overview
Comment:Map fatal TODO to System calls.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 138b9c48ffce9d3e8e9767e19da5a703b6f577cd
User & Date: stephanie.gawroriski 2019-06-16 23:25:34
Context
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
23:19
Implement trace resolution. check-in: aa105a6809 user: stephanie.gawroriski tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to runt/apis/cldc-compact/cc/squirreljme/jvm/SystemCallIndex.java.

99
100
101
102
103
104
105




106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
	/** Gets the specified call stack item. */
	public static final short CALL_STACK_ITEM =
		20;
	
	/** Returns the string of the given pointer. */
	public static final short LOAD_STRING =
		21;




	
	/** System call count. */
	public static final short NUM_SYSCALLS =
		22;
	
	/**
	 * Not used.
	 *
	 * @since 2019/05/23
	 */
	private SystemCallIndex()
	{
	}
}








>
>
>
>



|











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
	/** Gets the specified call stack item. */
	public static final short CALL_STACK_ITEM =
		20;
	
	/** Returns the string of the given pointer. */
	public static final short LOAD_STRING =
		21;
	
	/** Fatal ToDo hit. */
	public static final short FATAL_TODO =
		22;
	
	/** System call count. */
	public static final short NUM_SYSCALLS =
		23;
	
	/**
	 * Not used.
	 *
	 * @since 2019/05/23
	 */
	private SystemCallIndex()
	{
	}
}

Changes to runt/apis/cldc-compact/todo/OOPS.java.

6
7
8
9
10
11
12
13

14
15
16
17
18
19
20
..
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
..
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package todo;

import cc.squirreljme.runtime.cldc.asm.DebugAccess;

import cc.squirreljme.runtime.cldc.debug.CallTraceElement;
import java.io.PrintStream;

/**
 * This is an error which is thrown when a condition which should not occur
 * occurs.
 *
................................................................................
	public OOPS(String __m, Throwable __t)
	{
		super(__m, __t);
		
		// Detect OOPSes/TODOs tripping multiple times and fail
		boolean doubletripped = TODO._DOUBLE_TRIP;
		if (doubletripped)
			DebugAccess.fatalTodoReport(DebugAccess.rawCallTrace());
		TODO._DOUBLE_TRIP = true;
		
		// Print a starting banner, but only if the error stream exists
		PrintStream ps = System.err;
		if (ps != null)
		{
			// Top banner
................................................................................
		}
		
		// No streams are currently available, but we would still like to
		// report the trace information to the debugger, we might not be in any
		// condition to actually do printing to the console so this will end
		// here
		else
			DebugAccess.fatalTodoReport(DebugAccess.rawCallTrace());
		
		// {@squirreljme.property
		// cc.squirreljme.nooopsexit=(boolean)
		// If this is {@code true} then the OOPS exception will not tell the
		// virtual machine to exit.}
		if (!Boolean.valueOf(
			System.getProperty("cc.squirreljme.nooopsexit")))







|
>







 







|







 







|







6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
..
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
..
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package todo;

import cc.squirreljme.jvm.Assembly;
import cc.squirreljme.jvm.SystemCallIndex;
import cc.squirreljme.runtime.cldc.debug.CallTraceElement;
import java.io.PrintStream;

/**
 * This is an error which is thrown when a condition which should not occur
 * occurs.
 *
................................................................................
	public OOPS(String __m, Throwable __t)
	{
		super(__m, __t);
		
		// Detect OOPSes/TODOs tripping multiple times and fail
		boolean doubletripped = TODO._DOUBLE_TRIP;
		if (doubletripped)
			Assembly.sysCallP(SystemCallIndex.FATAL_TODO);
		TODO._DOUBLE_TRIP = true;
		
		// Print a starting banner, but only if the error stream exists
		PrintStream ps = System.err;
		if (ps != null)
		{
			// Top banner
................................................................................
		}
		
		// No streams are currently available, but we would still like to
		// report the trace information to the debugger, we might not be in any
		// condition to actually do printing to the console so this will end
		// here
		else
			Assembly.sysCallP(SystemCallIndex.FATAL_TODO);
		
		// {@squirreljme.property
		// cc.squirreljme.nooopsexit=(boolean)
		// If this is {@code true} then the OOPS exception will not tell the
		// virtual machine to exit.}
		if (!Boolean.valueOf(
			System.getProperty("cc.squirreljme.nooopsexit")))

Changes to runt/apis/cldc-compact/todo/TODO.java.

6
7
8
9
10
11
12
13

14
15
16
17
18
19
20
..
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
...
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package todo;

import cc.squirreljme.runtime.cldc.asm.DebugAccess;

import cc.squirreljme.runtime.cldc.debug.CallTraceElement;
import cc.squirreljme.runtime.cldc.lang.GuestDepth;
import java.io.PrintStream;

/**
 * This exception is thrown.
 *
................................................................................
	public TODO(String __s)
	{
		super(__s);
		
		// Detect TODOs tripping multiple times and fail
		boolean doubletripped = TODO._DOUBLE_TRIP;
		if (doubletripped)
			DebugAccess.fatalTodoReport(CallTraceElement.traceRaw());
		TODO._DOUBLE_TRIP = true;
		
		// Print a starting banner, but only if the error stream exists
		PrintStream ps = System.err;
		if (ps != null)
		{
			ps.println("****************************************************");
................................................................................
		}
		
		// No streams are currently available, but we would still like to
		// report the trace information to the debugger, we might not be in any
		// condition to actually do printing to the console so this will end
		// here
		else
			DebugAccess.fatalTodoReport(CallTraceElement.traceRaw());
		
		// {@squirreljme.property
		// cc.squirreljme.notodoexit=(boolean)
		// If this is {@code true} then the ToDo exception will not tell the
		// virtual machine to exit.}
		if (!Boolean.valueOf(
			System.getProperty("cc.squirreljme.notodoexit")))







|
>







 







|







 







|







6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
..
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
...
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package todo;

import cc.squirreljme.jvm.Assembly;
import cc.squirreljme.jvm.SystemCallIndex;
import cc.squirreljme.runtime.cldc.debug.CallTraceElement;
import cc.squirreljme.runtime.cldc.lang.GuestDepth;
import java.io.PrintStream;

/**
 * This exception is thrown.
 *
................................................................................
	public TODO(String __s)
	{
		super(__s);
		
		// Detect TODOs tripping multiple times and fail
		boolean doubletripped = TODO._DOUBLE_TRIP;
		if (doubletripped)
			Assembly.sysCallP(SystemCallIndex.FATAL_TODO);
		TODO._DOUBLE_TRIP = true;
		
		// Print a starting banner, but only if the error stream exists
		PrintStream ps = System.err;
		if (ps != null)
		{
			ps.println("****************************************************");
................................................................................
		}
		
		// No streams are currently available, but we would still like to
		// report the trace information to the debugger, we might not be in any
		// condition to actually do printing to the console so this will end
		// here
		else
			Assembly.sysCallP(SystemCallIndex.FATAL_TODO);
		
		// {@squirreljme.property
		// cc.squirreljme.notodoexit=(boolean)
		// If this is {@code true} then the ToDo exception will not tell the
		// virtual machine to exit.}
		if (!Boolean.valueOf(
			System.getProperty("cc.squirreljme.notodoexit")))

Changes to runt/klib/supervisor/cc/squirreljme/jvm/SystemCallIndex.java.

99
100
101
102
103
104
105




106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
	/** Gets the specified call stack item. */
	public static final short CALL_STACK_ITEM =
		20;
	
	/** Returns the string of the given pointer. */
	public static final short LOAD_STRING =
		21;




	
	/** System call count. */
	public static final short NUM_SYSCALLS =
		22;
	
	/**
	 * Not used.
	 *
	 * @since 2019/05/23
	 */
	private SystemCallIndex()
	{
	}
}








>
>
>
>



|











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
	/** Gets the specified call stack item. */
	public static final short CALL_STACK_ITEM =
		20;
	
	/** Returns the string of the given pointer. */
	public static final short LOAD_STRING =
		21;
	
	/** Fatal ToDo hit. */
	public static final short FATAL_TODO =
		22;
	
	/** System call count. */
	public static final short NUM_SYSCALLS =
		23;
	
	/**
	 * Not used.
	 *
	 * @since 2019/05/23
	 */
	private SystemCallIndex()
	{
	}
}