BizHawk icon indicating copy to clipboard operation
BizHawk copied to clipboard

[PSX] Using debugger on MainRAM throws readable but unhandled exception

Open dart193 opened this issue 4 years ago • 3 comments

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.

dart193 avatar Sep 29 '19 21:09 dart193

Breakpoints don't work in any core. Use lua memory hooks.

vadosnaprimer avatar Sep 30 '19 14:09 vadosnaprimer

The point is not that they don't work but that trying to use them result in an unhandled exception. But thanks for advice.

dart193 avatar Oct 01 '19 12:10 dart193

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.

CasualPokePlayer avatar Jun 24 '22 13:06 CasualPokePlayer