Some lua catchup and cleanup

- add nhl_pcall_handle() to wrap all nhl_pcall calls that didn't check
  return value and either panic() or impossible()
- add --loglua (unix only) to dump Lua memory and steps info to livelog
- remove old logging
- set memory and step limits on all Lua VMs
This commit is contained in:
nhkeni
2023-12-31 12:28:15 -05:00
parent 36e8e504c2
commit c7ab9a0565
17 changed files with 181 additions and 102 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.7 allmain.c $NHDT-Date: 1697779529 2023/10/20 05:25:29 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.223 $ */
/* NetHack 3.7 allmain.c $NHDT-Date: 1704225560 2024/01/02 19:59:20 $ $NHDT-Branch: keni-luabits2 $:$NHDT-Revision: 1.238 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2012. */
/* NetHack may be freely redistributed. See license for details. */
@@ -511,7 +511,7 @@ moveloop_core(void)
if (gl.luacore && nhcb_counts[NHCB_END_TURN]) {
lua_getglobal(gl.luacore, "nh_callback_run");
lua_pushstring(gl.luacore, nhcb_name[NHCB_END_TURN]);
nhl_pcall(gl.luacore, 1, 0);
nhl_pcall_handle(gl.luacore, 1, 0, "moveloop_core", NHLpa_panic);
}
}