BizHawk
BizHawk copied to clipboard
[PSX] Using debugger on MainRAM throws readable but unhandled exception
When I try to set a breakpoint in debugger with (the only) PSX core on an address that is located in the MainRAM, an exception is thrown. It does says "MainRAM is not currently supported for callbacks", but it however says that the exception is unhandled; it is actually thrown via .NET unhandled exception dialog box. According to adelikat, it is not actually supposed to be unhandled exception. While the emulator will keep running if you press Continue, it would be better if the exception was handled and shown via cusom dialog box, mostly to avoid unexpected consequences.
Breakpoints don't work in any core. Use lua memory hooks.
The point is not that they don't work but that trying to use them result in an unhandled exception. But thanks for advice.
https://github.com/TASEmulators/BizHawk/blob/99260d274668e29990e8c6404ca4cd4656574dc3/src/BizHawk.Emulation.Common/Interfaces/IMemoryCallbackSystem.cs#L64 The exception does seem to be intended.
"Unhandled exception" really just means "thrown outside of a try/catch block." Preventing the exception from being ""unhandled"" just means expecting the caller to put the call behind a try catch block, which is a bit wasteful (and better yet it should just be checking the scope you tried to put in against AvailableScopes, and handle it a bit more gracefully).
On another note practically every core only implements a single scope for memory callbacks (System Bus), Gambatte is the only core which implements multiple scopes.
Breakpoints don't work in any core. Use lua memory hooks.
Lua memory hooks would throw similarly, although that just shuts down the lua environment if anything.