Page 1 of 1

Full Memory Dump

Posted: Thu May 09, 2019 2:39 pm
by raidho36
Here's a script to dump the entire Lua state memory into a text file. It handles circular dependencies and metatables, function upvalues and local variables for currently running functions. You can use it to create crash dumps, and with a custom tool you can analyze the memory and try to figure out what caused the crash. For every function, it displays all available information (where it's defined, etc), it's upvalues and locals. For every table, it displays its metatable in parenthesis and dumps key-value pairs. For userdata, it displays its metatable (userdata doesn't have its own data). And for cdata, well, it just shows that it's there, because no information is accessible about it.