1. Add cmake support in CMakeLists.txt according to https://developer.android.com/ndk/guides/other_build_systems
2. Resolve symbols errors
3. Backport fixes from 438ed42311
> QEMU relies on two optimization for ppc64 and arm:
>
> 1. if(0) /* optimized code */
> 2. assert(0); /* optimized code */
>
> But the assert on mingw32 doesn't have noreturn attribute which prevents
> the second optimization and some code is reverted to the original code
> to fit in the first optimization.
>
> The assert implementation is copied from glib as qemu did.
Unfortunately, NDK also doesn't have an assert implementation qemu prefers.
* Fix wrong sync after UC_ERR_[READ, WRITE, FETCH]_[UNMAPPED, PROT]
Note that:
1. We only guarantee the pc (and other internal states) is correct
if and only of `uc_emu_start` returns without any error (or errors
have been handled in callbacks.).
2. If memory read/write error isn't handled by hooks, the state is
undefined and the pc is probably wrong if no hook is installed.
This fixes#1323.
* Rename variables
* Add note in unicorn.h
* Refine test_i386_invalid_mem_read_in_tb
* Add setjmp wrapper
* Add to projects
* Use wrapper on x64
* Always build on x64 and exclude on win32
* Fix signature
* Add comments
* Add comments for os-win32.h
* Add extern decleration
* Support cmake Windows build
* Fix for MinGW
When unicorn and systemd are combined into a single binary the 2
libraries conflict on bitmap_set and bitmap_clear functions which breaks
unicorn.
Co-authored-by: Nicolae Mogoreanu <mogo@google.com>
- Q flag / GE flag were not included in APSR register (read/write)
- UC_ARM_REG_APSR_NZCV register constant was ignored completely.
- regression test added
* Fix watchpoint leak in ARM
* Builds fuzz targets with sanitizer support
* Builds fuzz targets with directory driver
* Adds script to dowlonad public corpus
* Adds CIfuzz
To checks Pull Requests with fuzzing
* Use static library for fuzz targets
* Less verbose logs for fuzz driver directory
* fix finding python path which only has python3.
* fix#1246, arm host issue.
* skip assembler tests on non-x86 host.
* update macro of dummy value.
* fix MSVC macro.
* update dummy array value macro.
* restore to original qemu code.
* Handle the cpu context save in a more pythonic way, so the context can be serialized and reuse in an other process using the same emulator architecture and modes
* Fix type error ; mistakes a size_t uint64_t ; breaks in 32bit...
* Fix the UAF situation when deleting a hook while being in a hook callback. Added an attribute 'to_delete' to hooks, and a list hooks_to_del to delay the free of the hooks
* Minor fixes ; forgot return type of clear_deleted_hooks ; do not declare variable in for predicate
* x86: setup FS & GS base
* Fixed base register writes for x64, removed then for x16/x32 (the don't exist there?)
* FS reg comes before GS so the base regs do so, too
* added shebang to const_generator.py
* Added base regs to and added 'all' support to const_generator
Co-authored-by: naq <aquynh@gmail.com>
Ensure the TCG exit flag is cleared at the end of cpu_exec. This ensures
that subsequent calls are not polluted by the prior call to request an
early exit. The symptoms of the problem being addressed here are that
after a cpu_exit call triggered within a hook there may still be a
pending tcg_exit_req flag set. This then causes a block to start its
execution and then be aborted (from which point it'll continue because
there's no other condition to service). The start of the execution
causes the block hook to be called, no actual code to be run, and then
the block started again with another block hook call.
This change is discussed in ticket 1193:
https://github.com/unicorn-engine/unicorn/issues/1193