Full Memory Dump

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
User avatar
raidho36
Party member
Posts: 2063
Joined: Mon Jun 17, 2013 12:00 pm

Full Memory Dump

Post 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.
Attachments
memorydump.lua
(2.55 KiB) Downloaded 240 times
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 52 guests