Check-in [d365f39ae5]

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

Overview
Comment:Add exception handler catch all in the bootstrap.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: d365f39ae5eb46be04887ae2910deaf1b1784939
User & Date: stephanie.gawroriski 2019-06-16 20:16:14
Context
2019-06-16
22:40
Define API for obtaining the call stack. check-in: 3dea657674 user: stephanie.gawroriski tags: trunk
20:16
Add exception handler catch all in the bootstrap. check-in: d365f39ae5 user: stephanie.gawroriski tags: trunk
20:11
Clear the exception register when an excpetion is handled, otherwise it will just propogate up always. check-in: 22c1ca4e4a user: stephanie.gawroriski tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

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

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
		int __rombase, int __romsize, int __confbase, int __confsize)
	{
		// Initialize the RAM links to setup dirty bits and initialize the
		// last block of memory with anything that remains. This makes it so
		// the RAM is actually useable.
		Allocator.__initRamLinks(__rambase, __ramsize);
		



		// Basic SquirrelJME Banner
		todo.DEBUG.note("SquirrelJME Run-Time 0.3.0");
		
		// Load boot libraries that are available
		try
		{
			BootLibrary[] bootlibs = BootLibrary.bootLibraries(__rombase);
		}





		catch (Throwable t)
		{
			todo.DEBUG.note("Threw a throwable!");

		}


		

		Assembly.breakpoint();
		throw new todo.TODO();


	}
}








>
>
>
|
|
|
|
<
<

|
>
>
>
>
>


<
>
|
>
>
|
>
|
<
>
>



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
		int __rombase, int __romsize, int __confbase, int __confsize)
	{
		// Initialize the RAM links to setup dirty bits and initialize the
		// last block of memory with anything that remains. This makes it so
		// the RAM is actually useable.
		Allocator.__initRamLinks(__rambase, __ramsize);
		
		// Could crash!
		try
		{
			// Basic SquirrelJME Banner
			todo.DEBUG.note("SquirrelJME Run-Time 0.3.0");
			
			// Load boot libraries that are available


			BootLibrary[] bootlibs = BootLibrary.bootLibraries(__rombase);
			
			Assembly.breakpoint();
			throw new todo.TODO();
		}
		
		// It crashes
		catch (Throwable t)
		{

			todo.DEBUG.note("Uncaught exception: %s", t.getMessage());
			
			// Try to exit the VM
			Assembly.sysCallP(SystemCallIndex.EXIT, 1);
			
			// If that did not work, just break and return!
			Assembly.breakpoint();

			return;
		}
	}
}

Changes to runt/klib/supervisor/java/lang/Throwable.java.

65
66
67
68
69
70
71
72


73









	 * @since 2019/05/25
	 */
	public Throwable(Throwable __t)
	{
		this._message = null;
		this._cause = __t;
	}
}



















|
>
>
|
>
>
>
>
>
>
>
>
>
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
	 * @since 2019/05/25
	 */
	public Throwable(Throwable __t)
	{
		this._message = null;
		this._cause = __t;
	}
	
	/**
	 * Returns the message.
	 *
	 * @return The message used.
	 * @since 2019/06/16
	 */
	public String getMessage()
	{
		return this._message;
	}
}