Check-in [aa105a6809]

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

Overview
Comment:Implement trace resolution.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: aa105a6809d46d971a6e552f7030c8fc671728a9
User & Date: stephanie.gawroriski 2019-06-16 23:19:02
Context
2019-06-16
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
23:05
Implement CallTraceElement.traceRaw(). check-in: 21f1d5cbaa user: stephanie.gawroriski tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

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

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
	/** The method name. */
	public static final short METHOD_NAME =
		1;
	
	/** The method type. */
	public static final short METHOD_TYPE =
		2;




	
	/** Source line. */
	public static final short SOURCE_LINE =
		3;
	
	/** The PC address. */
	public static final short PC_ADDRESS =
		4;
	
	/** Java operation. */
	public static final short JAVA_OPERATION =
		5;
	
	/** Java PC address. */
	public static final short JAVA_PC_ADDRESS =
		6;
	
	/** The number of supported items. */
	public static final short NUM_ITEMS =
		7;

}








>
>
>
>



|



|



|



|



<
>


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
	/** The method name. */
	public static final short METHOD_NAME =
		1;
	
	/** The method type. */
	public static final short METHOD_TYPE =
		2;
	
	/** The current file. */
	public static final short SOURCE_FILE =
		3;
	
	/** Source line. */
	public static final short SOURCE_LINE =
		4;
	
	/** The PC address. */
	public static final short PC_ADDRESS =
		5;
	
	/** Java operation. */
	public static final short JAVA_OPERATION =
		6;
	
	/** Java PC address. */
	public static final short JAVA_PC_ADDRESS =
		7;
	
	/** The number of supported items. */
	public static final short NUM_ITEMS =

		8;
}

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

95
96
97
98
99
100
101




102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
	/** Get the height of the call stack. */
	public static final short CALL_STACK_HEIGHT =
		19;
	
	/** Gets the specified call stack item. */
	public static final short CALL_STACK_ITEM =
		20;




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








>
>
>
>



|











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
	/** Get the height of the call stack. */
	public static final short CALL_STACK_HEIGHT =
		19;
	
	/** 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()
	{
	}
}

Changes to runt/apis/cldc-compact/cc/squirreljme/runtime/cldc/debug/CallTraceElement.java.

651
652
653
654
655
656
657
658











659







660







661

























	{
		if (__trace == null)
			throw new NullPointerException("NARG");
		
		// Get the call height
		int callheight = __trace.length / CallStackItem.NUM_ITEMS;
		
		throw new todo.TODO();











	}







}








































|
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
	{
		if (__trace == null)
			throw new NullPointerException("NARG");
		
		// Get the call height
		int callheight = __trace.length / CallStackItem.NUM_ITEMS;
		
		// Process all the items
		CallTraceElement[] rv = new CallTraceElement[callheight];
		for (int z = 0, base = 0; z < callheight; z++,
			base += CallStackItem.NUM_ITEMS)
		{
			// Load class name
			int xcl = Assembly.sysCallV(SystemCallIndex.LOAD_STRING,
				__trace[CallStackItem.CLASS_NAME]);
			String scl = ((xcl == 0 || Assembly.sysCallV(
				SystemCallIndex.ERROR_GET, SystemCallIndex.LOAD_STRING) !=
				SystemCallError.NO_ERROR) ?
				(String)null : (String)Assembly.pointerToObject(xcl));
				
			// Load method name
			int xmn = Assembly.sysCallV(SystemCallIndex.LOAD_STRING,
				__trace[CallStackItem.METHOD_NAME]);
			String smn = ((xmn == 0 || Assembly.sysCallV(
				SystemCallIndex.ERROR_GET, SystemCallIndex.LOAD_STRING) !=
				SystemCallError.NO_ERROR) ?
				(String)null : (String)Assembly.pointerToObject(xmn));
			
			// Load method type
			int xmt = Assembly.sysCallV(SystemCallIndex.LOAD_STRING,
				__trace[CallStackItem.METHOD_NAME]);
			String smt = ((xmt == 0 || Assembly.sysCallV(
				SystemCallIndex.ERROR_GET, SystemCallIndex.LOAD_STRING) !=
				SystemCallError.NO_ERROR) ?
				(String)null : (String)Assembly.pointerToObject(xmt));
			
			// Load source file
			int xsf = Assembly.sysCallV(SystemCallIndex.LOAD_STRING,
				__trace[CallStackItem.SOURCE_FILE]);
			String ssf = ((xsf == 0 || Assembly.sysCallV(
				SystemCallIndex.ERROR_GET, SystemCallIndex.LOAD_STRING) !=
				SystemCallError.NO_ERROR) ?
				(String)null : (String)Assembly.pointerToObject(xsf));
			
			// Build elements
			rv[z] = new CallTraceElement(
				scl,
				smn,
				smt,
				__trace[CallStackItem.PC_ADDRESS],
				ssf,
				__trace[CallStackItem.SOURCE_LINE],
				__trace[CallStackItem.JAVA_OPERATION],
				__trace[CallStackItem.JAVA_PC_ADDRESS]);
		}
		
		// Use the resolved form
		return rv;
	}
}

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

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
	/** The method name. */
	public static final short METHOD_NAME =
		1;
	
	/** The method type. */
	public static final short METHOD_TYPE =
		2;




	
	/** Source line. */
	public static final short SOURCE_LINE =
		3;
	
	/** The PC address. */
	public static final short PC_ADDRESS =
		4;
	
	/** Java operation. */
	public static final short JAVA_OPERATION =
		5;
	
	/** Java PC address. */
	public static final short JAVA_PC_ADDRESS =
		6;
	
	/** The number of supported items. */
	public static final short NUM_ITEMS =
		7;

}








>
>
>
>



|



|



|



|



<
>


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
	/** The method name. */
	public static final short METHOD_NAME =
		1;
	
	/** The method type. */
	public static final short METHOD_TYPE =
		2;
	
	/** The current file. */
	public static final short SOURCE_FILE =
		3;
	
	/** Source line. */
	public static final short SOURCE_LINE =
		4;
	
	/** The PC address. */
	public static final short PC_ADDRESS =
		5;
	
	/** Java operation. */
	public static final short JAVA_OPERATION =
		6;
	
	/** Java PC address. */
	public static final short JAVA_PC_ADDRESS =
		7;
	
	/** The number of supported items. */
	public static final short NUM_ITEMS =

		8;
}

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

95
96
97
98
99
100
101




102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
	/** Get the height of the call stack. */
	public static final short CALL_STACK_HEIGHT =
		19;
	
	/** Gets the specified call stack item. */
	public static final short CALL_STACK_ITEM =
		20;




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








>
>
>
>



|











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
	/** Get the height of the call stack. */
	public static final short CALL_STACK_HEIGHT =
		19;
	
	/** 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()
	{
	}
}