Commit Graph

512 Commits

Author SHA1 Message Date
YoshiRulz 28ff2231f2
Update mGBA Linux binary
Windows binary rebuilt in 78931e025
taken from https://gitlab.com/TASVideos/BizHawk-ports-CI/-/jobs/968003727
2021-01-17 23:31:12 +10:00
nattthebear 72ea5ce866
Waterbox: Allow SEH unwinding through guest calls. (#2519)
The goal of the separate stacks was to allow this, but I never quite finished the job.  Now, when a SEH exception (generally a Rust panic in a guest syscall handler, or a C# Exception in a callback) tries to unwind through guest code, it works.  Note that we don't actually unwind the guest stack, as there's nothing useful to be gained from that;  When an emulator core throws an exception like this, it should be considered completely hosed.  Throw it out and get a new one.

There were two bugs stopping this from working.

First of all, we had custom thunks that lacked sufficient unwind information for RtlUnwind to get through.  For the sysv <-> msabi adapter, this was fixed by making it regular Rust code instead of hand assembled junkus.  So the compiler generates valid unwind information for all of that.  Then we just JIT a small stub on top in the MsHostSysVGuest code, which needs no unwind information because it won't throw an exception itself and transparently passes execution to something with valid unwind information without invalidating that information.  (NB:  Clr JIT stubs use the same strategy.)  For the host <-> guest stack transition code, a small hand generated unwind stub was added to interop.s that is registered with `RtlAddFunctionTable`.  I've seen the unwind work successfully without this second set of unwind information, but better safe than sorry.

Secondly, our misuse of SubSystemTib caught up with us.  It's an old field, allegedly from OS/2, that we repurposed to hold TLS information needed for the waterbox stack transitions.  Most people think nothing uses it any more, but in fact if it's set to a non-NULL value, but doesn't contain valid information, `KERNELBASE!GetModuleFileNameW` will crash when it tries to get a module name from there.  The fix here was to simply tighten up our usage of SubSystemTib:  We were already nulling it out when returning from guest code, but not when calling back to host code in guest code.

Fixes #2487.  Unwinding of this sort has never worked well in waterbox; the reason why that issue is more recent is that the particular reproducing case of firmware didn't cause an exception in a callback in older code; the exception happened in pure managed code.
2020-12-13 19:12:16 -05:00
nattthebear 98ad14ff47 Fix two semi-related savestate bugs in waterbox.
We had two instances where the act of sealing could lose snapshots that were never recovered.  It's oof.
2020-10-13 09:10:46 -04:00
YoshiRulz c0b755a33b
Recompile Cygne, Handy, mGBA, and QuickNes for Linux 2020-09-26 22:19:02 +10:00
YoshiRulz 5ae13a2309
Change build path of executables to output/dll
* post-build step moves .exes up a level, to output
* also fixed OpenTK.dll.config location
* also removed redundant step from packaging scripts
* future executables need to be capable of resolving assemblies in dll
2020-09-22 09:39:53 +10:00
YoshiRulz fb5a5ed78c
Add libdarm.so, migrate Darm class to BizInvoker
`Tools` > `Debugger` no longer crashes immediately on Linux with mGBA core
2020-09-21 01:38:09 +10:00
James Groom a5d166cf71
Partial fix for #2353 (files in dev builds) (#2410)
* Move .so libraries to dll dir, update some build scripts

* Move OpenTK.dll.config with OpenTK.dll

* Keep EmuHawkMono.sh in Windows-built artifacts

* Add Package.sh to match QuickTestBuildAndPackage.bat

used as `Dist/BuildRelease.sh && Dist/Package.sh`

* Update GitLab CI to use Package.sh
2020-09-18 20:08:34 -05:00
zeromus d4cb18aff8 actual remove CGC.exe, that was the whole point wasnt it 2020-06-20 00:48:42 -04:00
YoshiRulz 8c7862aa8a
Fix .so versioning 2019-10-25 21:33:05 +10:00
zeromus 6ced541abe ok, it's over. exe packing is for the birds 2016-03-24 19:10:08 -05:00
zeromus d7cd62c4d6 compress cgc.exe differently (cexe, doesn't really trip virus scanners) since upx can't handle it; add Firmware directory to dist script 2016-03-24 16:42:33 -05:00
nattthebear 76ccefb3c6 Properly move cgc to the Assets/dll folder 2016-03-01 22:12:36 -05:00