Tags: dargueta/unicorn-lua
Tags
2.3.1 (#50) * Update rockspec for 2.3.1 * Handle coprocessor registers deterministically * Update changelog * Fix ARM/ARM64 access on Unicorn 1.x * Bump tested Unicorn 2.1.x * Update changelog, dev tweaks * Crash with a different error message if Unicorn does not support 80-bit floats * Fix MSR/coprocessor register reads, failed builds on 1.0.0 where there's no x86 MSR support * Document stuff * Register IDs aren't unique across all architectures * Some types are not defined if there is no MSR/coproc support * Shuffle MSR/control reg cases around to indicate unreachable code better * Tweak settings and test rules * (BROKEN) Try reading CPUID * Fix broken test * Use a macro constant if MSR access is not supported * Windows? * Never mind, no Windows * Try regular LuaJIT * Upgrade default LuaRocks installation version * Minor comment tweaks * Add CPUID hook support back in * Generate file listing architecture support * Handle missing headers (e.g. if the architecture isn't built in) * Fix very very broken instruction hook creation * Return value from CPUID hook should be a boolean * Completely fix CPUID hook * Shrink diff * Don't test CPUID on Unicorn 1 * Exclude static CPUID hook function definition in UC 1.x * Use Ubuntu 22.04 so we can run Unicorn 2.0 on it * CPUID hook is tested elsewhere * Fix C11 bug with _Noreturn and some undefined stuff * Bit shift for integer comparisons * Crash if the CPUID hook returns anything but a boolean * Fix CMake version compatibility issue * Update changelog * Pass CPUID tests on 2.1.4 * Fix byte order * Fix CPUID tests, maybe. * GCC 14 gets pissy with -Wsuggest-attribute=const|pure * Code cleanup * Reorder variables in luaenv.mk script. This probably won't change anything, but it can't hurt. * Create special case for assert.has_error() on LuaJIT * Try this again * Revert "Try this again" This reverts commit cf16f23. * Forget about LuaJIT when pcall() is needed * Add documentation
(Idea) Mixed-language library overhaul (#45) * Start mixed-language library overhaul * Remove unnecessary header * (BROKEN) Break out header processing to a separate script * Add LDoc * Move register constants to a Lua file instead of CPP * Change include file for registers_const so we can use C not C++ * Forgot to update C library name * Update rockfile * Fix C library name (unicorn -> unicorn_c_) * Fix broken imports and other stuff * Add copyright notice to generated Lua files * Add more documentation * Sort constants in *_const.lua modules * Add ability to predefine docstrings * Documentation fixes * Add support for individual const docs and adding sections * Add documentation and sections for all architectures * Mostly documentation, a few type fixes * Split out documentation generation into a separate rule * Update LDoc config * Fix template typo and doc settings * Documentation, move hook/context cleanup out of emu_stop() * Implement some stubs, add some documentation * Lots of documentation, fix handle wrapping bugs in Context * emu_start() docs * Start implementing hooks * Begin complete C rewrite * This is going to be a nightmare * Add functions to main C library * Add control functions * The overhaul continues... * Many many changes * Implement uc_strerror * Add more documentation, give up on C file docs * Switch template line escape from @ to ! * Fix bug in misinterpreting return value of uc_version() * Relocate old C++ test functions * Implement control functions and some engine stuff * Move library version number into Lua * Make end address default to 0 in emu_start * Fix and simplify error messages * Fix a bunch of format string bugs * Simplify error message format for `ulinternal_crash_if_failed()` * Simplify Busted invocation * Fix wrong handle name * Implement mem_read() * Fix `mem_read()` and implement `mem_write()` * Fix changed function name for Unicorn 1.x unsupported exception function * Perhaps fix some Unicorn warnings and linking problems * Fix module registration on 5.1 * `lua_geti()` wasnt added until 5.3 * Exclude control functions from 1.x binding * Fix library search paths for the Unicorn Engine * Start implementing hooks * Fix some compilation errors, better error message * Simplify Makefile and fix wrong flags passed to CC * Bind engine and userdata in Lua not C, implement more hooks * Add a bunch more hooks * Fix false positives when ignoring function macros * Remove "not implemented" crash in hook_add() * Fix compilation errors with warning disable in wrong place * Implement most register read/write operations * Simplify hook struct and refactor for less code * Remove warning flags and only do that in CI * Don't use lua_geti on Lua <5.3 * Don't add hooks missing in Unicorn 1.x * Add unsupported functions back in, but crash * Fix utterly broken hook callbacks * In the destructor, don't call emu_stop() if not running * Rephrase unclear comments * Used wrong macro name in #if -- how did this even compile?! * Forgot to save hard references to hooks * (BROKEN) Use userdata for hooks instead of malloc * Fix resource leak; hook callback was never released * Handle case where x86 architecture is unavailable * (BROKEN) Many fixes for hooks, implement bulk register reads * Fix argument passing in register bulk read * Minor reformatting and variable renaming for easier reading * Fix utterly broken hooks * Add comments on why we need the hook table * Fix test exclusion on Lua <5.3 * Fix `busted` settings * Reenable test shuffling * A LOT of fiddling * Fix hook problems -- it was the tests! * Delete old C++ code * Delete old debugging code * Add illegal instruction hook, make hook struct userdata instead of manual memory management * Bump binding version to 2.3.0 * Makefile simplifications * Remove fallback Lua include directory * Implement more control functions * Fix C flags * Update changelog * Handle (slightly) more complex macros in Unicorn headers * Templatize hook functions * Remove redundant hook declaration * Use copyright_notice variable in templates instead of duplicating text * Simplify templated hook definitions * Check hook creation arguments are integers * Check more arguments' types, do minimal memory copies, show register type slugs * Make memory allocation more efficient for bulk writes, minor other tweaks * Rearrange declarations for easier reading, remove dead stuff * Comments * Reorganize a bunch of stuff for LDoc, add can_*() methods for MemoryRegion * Try to document C stuff * Fix float array representation * Documentation and update changelog * Special handling for _REG_ENDING and _REG_INVALID enums * Template doc cleanup * Use rawseti() where possible * Rearrange exports to make doc formatting better * Factor out error functions into separate file * Engine:do_ctl is not a thing anymore * Allow user to pass custom flags to linker * Lots of documentation * Fix wrong variable name, forgot +1 in array append * Bug: Indexing starts at 1 in Lua, not 0 * Documentation fixes for utility functions, consolidate some macro definitions * Fix printf format (used d instead of u by accident) * Imlement some context stuff * (BROKEN) Add context support back * Add .envrc to ignore list * Add test phony rule for convenience * Add many compiler flags when debugging * Ignore additional files * Documentation fixes * Finally fix broken contexts! * Compile strict C99 when debugging * Fix missing `void` argument in main() * More warnings * Revert "More warnings" This reverts commit fab33a6. * Update copyright years
Infer system lua (#30) * Fling stuff against the wall * Add inference script * Fix a couple things * Allow various output formats * Change Makefile to build settings files * Fix paths * Add call to `configure` script with args * Add installation Makefile target * Fix referencing a deleted function * Fix a bunch of path stuff, consolidate to use LuaRocks variable names * Update changelog * MOre variable cleanup * Reorganize Makefile, remove usage of $(join ...) * I changed my mind, this is 2.0.0 not 1.3.0 * Fix `clean` rule in Makefile * Shuffle code around for readability * Handle Lua version numbers with multiple digits (e.g. 5.12) * Add generic functions for LuaRocks download & install * Upgrade Lua and LuaRocks versions * Change directory search order, locate liblua.a * Formatting cleanup in Makefile * Fix CI invocation * Apparently $(realpath...) is broken * Use GHA for installing Lua * Explicitly link to Lua, provide path * Compile Lua with PIC flag * Get version from stderr or stdout * Trigger a fatal error when we can't find the library files * Show list of where we looked for files on an error * Probably don't need the explicit `configure` invocation anymore? * Provide default value for the LuaRocks executable * Simplify default variable assignment * Fix path substitution * Factor out directory substitution, do it more aggressively * Add debugging print() calls * We were installing the wrong version of LuaJIT * Upgrade OS versions * Statically link Lua(?) to avoid -fPIC garbage * Convert relative paths to absolute ones, search current directory first * s/LUAROCKS_EXE/LUAROCKS/ * Fix bug in finding the Lua library too late * Python no longer required for configuration * Update changelog and readme * Crash if the executable directory can't be inferred * Debug printing * Overhaul search for Lua to handle existing abspath problem * Remove some debug printing * Missing `dirname()` call * Remove position-independent compilation flags from venv script * Remove unused variables, clean up other stuff * Add basic argument parsing, LUAROCKS variable output * Fix usage, reorganize variables, clean up crap, etc. * Further refactors, split stuff out into a config script * Add help message to configure script * (BROKEN) Start cleaning up build process * Forgot the debug flag * Fix quotes and other broken things * Change license --------- Co-authored-by: Diego Argueta <[email protected]>
Implement bulk read_as (#20) * Implement bulk read_as * Add documentation * Fix wrong variable name * Overhaul, use batch reading * Move to Github Actions instead of Travis * Bump installed Lua versions * More verbose logging, add library search hints for Unicorn * Fix working directory so ctest sees the tests * Mess with LD_LIBRARY_PATH on Linux * Fix early collection bug * Fix garbage collecting crash and add __close on engines too * Add CI for Mac OS * Stop using deprecated CMake stuff * Fix included comment, upgrade LuaRocks * Lazily install rocks, not in CMake initialization * --local no longer required * Minor code cleanup, fix exit code in `configure` * Many many bugfixes and C-isms * Fix broken examples * Miscellaneous minor build stuff * Add release/debug flags to settings * Use build-specific C++ flags instead of if/else * Add installation configuration * Use `make install` in CI * Fix some typecasting, initialize arrays, use range expressions * Make test depend on test executable * Use lua_Number instead of uclua_float80, add sNaN/qNaN distinction * Use platform-independent CMake commands * Finally fix infinity/NaN problems * Fix datatypes in disabled tests * Fix install prefix for Lua 5.1 * Fix signaling NaN on Mac OS * Move templates for busted stuff into the templates dir * Make `configure` run CMake * Fix LuaJIT linker error on OSX * Consolidate generated and configured files * Context double-free test * Fix attempt to match null pointer to C registry when closing engine * LuaJIT mimics Lua 5.1.4 not 5.1.0 * Remove definition of lua_Unsigned * [DEBUG ONLY] Disable context tests * Try to fix segfault on OSX LuaJIT in lua_seti() implementation * Try verbose mode for debugging * Make engine and Lua state private variables for UCLuaEngine * Let Lua manage context allocation * Start adding tests for LuaResourceTable * Fix wrong CMake variable name in a template * Update changelog * Fix wrong function call that just happened to work * Clean up the Lua stack before crashing in allocate() * [BROKEN] Allocate contexts on the heap, use indirect pointers for the userdata * Overhaul contexts again to make them structs * Fix segfault in destructor due to modifying set as we are iterating * Delete dead code, disable lua_seti tests on OSX+LuaJIT * Remove virtualenv dir when doing `make clean` * Update changelog * Update documentation * Disable segfaulting tests * Use more thorough asserts, remove extraneous engine handle * I must be losing my mind * Check the stack when panicking before pushing an error message * [BROKEN] Require the stack to be clean when exiting a test * Unconditionally clear the stack in ul_crash_on_error tests We need this because Lua can put stuff on the stack aside from our error message that we don't know about. Since all we care about is the error message at the top of the stack, we can clear it. * Update library version Co-authored-by: Diego Argueta <[email protected]>
PreviousNext