Commit Graph

8 Commits

Author SHA1 Message Date
b2e888f52e runtime: raise SIGABRT from the guest's abort() when a handler is installed
game_abort() ended the run directly, so a title's own SIGABRT handler never ran. Raise SIGABRT only when a handler is registered (the guest's signal() import binds to the host CRT), leaving the default and ignored cases ending with code 3 so the host is never killed. Add a synthetic fixture with handler, returning-handler, ignore and default modes plus a native-vs-loader exit-code test.

AI-assisted (OpenCode)
2026-11-23 01:31:08 +03:00
0f414f4838 tiny_game: the header names GAME:\tiny_game_probe.txt, not a tab
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 00:34:18 +05:30
a14ddbc63c gta6rt: GAME: and the overlay are absolute, so a bare image name has a game folder
`gta6rt --run game.exe`, started from the game folder, set the game folder to the image's parent path, which is
empty for a bare name: the run printed `console paths: GAME: -> , writes -> overlay` and every GAME: open failed
with ERROR_PATH_NOT_FOUND. A relative --game-dir or --overlay worked only until the title changed its current
directory. main.cpp now makes both absolute at startup (keeping the path as given if absolute() fails).

New CTest run_tiny_game_dir: tiny_game's opt-in `game-file` check moves its current directory, then reads
GAME:\tiny_game_probe.txt; check_game_dir.cmake runs it by bare name and with `--game-dir .`. Without the fix both
fail (open errors 3 and 2); with it both pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 00:24:49 +05:30
01cde4562b Verify the exact tiny game exit code in runtime tests 2026-11-22 20:38:19 +08:00
b4d7f7b279 tiny_game: opt-in checks by argument, and a CTest run for each
The thread_local and C++ exception checks were switched on by LEONIDA_RUN_TLS=1
and LEONIDA_RUN_EH=1. scripts/run_wine_tests.py passes a test's command line but
not its ENVIRONMENT property, so under Wine an environment-based test would only
ever see the SKIP path. They now take arguments after "hello 42" (`tls`, `eh`),
and CTest runs each in its own test, run_tiny_game_tls and run_tiny_game_eh.
run_tiny_game keeps running without them. stdout is unbuffered, so a crash still
shows how far the run got.
2026-11-22 12:29:52 +01:00
d1b75ca0cf tiny_game: C++ exception check opt-in again: MSVC's throw needs the image known to RtlPcToFileHeader, not only #176's tables 2026-11-22 00:12:44 +01:00
18e968a28b tiny_game: the C++ exception check is on by default now that #176 is on main 2026-11-22 00:08:20 +01:00
0ca9bb8bc0 Runtime: gta6rt --run, and a stand-in game executable run through the loader
gta6rt --run <exe> [-- args] maps and binds the executable, initialises its
modules and calls its entry point on a game thread. shims/process.cpp answers
the process-level imports through the game's own import table: argv/argc and
GetCommandLine are the game's (UCRT api-set/ucrtbase and msvcrt forms), and
exit/_exit/quick_exit/ExitProcess/abort end the run with that exit code
instead of the host. gta6rt then exits with the game's code directly, so the
game's atexit handlers don't run during host shutdown.

tiny_game.exe (CTest run_tiny_game, run_tiny_game_exit_code) does what a title
does in its first second: arguments, a static initializer, a 4 MiB allocation,
a file round trip, a thread, and xgameruntime.dll imports, which the shim
registry answers instead of the link-time stub. thread_local and a C++
exception are opt-in (LEONIDA_RUN_TLS / LEONIDA_RUN_EH) until #93 and #176.
2026-11-21 23:50:31 +01:00