Commit Graph

2036 Commits

Author SHA1 Message Date
Chen Huitao
68eb357984 fix some oss-fuzz bugs (#1180)
* fix oss-fuzz 10419.

* fix oss-fuzz 10427.

* fix oss-fuzz 10421.

* fix oss-fuzz 10422.

* fix oss-fuzz 10425.

* fix oss-fuzz 10426.

* fix oss-fuzz 10426.

* fix oss-fuzz 10422.

* fix oss-fuzz  10426.

* fix oss-fuzz 10456.

* fix oss-fuzz 10428.

* fix oss-fuzz 10429.

* fix oss-fuzz 10431.

* fix oss-fuzz 10435.

* fix oss-fuzz 10430.

* fix oss-fuzz 10436.

* remove unused var.
2020-01-04 23:42:02 +08:00
Charles Ferguson
99097cab4c Add implementation of access to the ARM SPSR register. (#1178)
The SPSR register is named within the Unicorn headers, but the code
to access it is absent. This means that it will always read as 0 and
ignore writes. This makes it harder to work with changes in processor
mode, as the usual way to return from a CPU exception is a
`MOVS pc, lr` for undefined instructions or `SUBS pc, lr, #4`
for most other aborts - which implicitly restores the CPSR from SPSR.

This change adds the access to the SPSR so that it can be read and
written as the caller might expect.
2020-01-02 09:42:01 +08:00
Nguyen Anh Quynh
810bd34eef python: handle UC_ERR_TIMEOUT, so sample_x86.py behaves like sample_x86.c 2020-01-01 10:11:16 +08:00
Nguyen Anh Quynh
fc8a42aeb8 spacing 2020-01-01 09:56:55 +08:00
Charles Ferguson
b59632fb64 Ensure that PC is not fixed up when code tracing or timing. (#1179)
Under some circumstances, the PC is not fixed up properly when
returning from the execution of a block in cpu_tb_exec. This appears
to be caused by the resetting of the PC from the tb.

This change removes the additional fixup in the cases where there
is code tracing or timing active. Either of these cases would result
in the wrong PC being reported.

Closes unicorn-engine#1105.
2020-01-01 09:55:08 +08:00
Nguyen Anh Quynh
b0d5837c61 bindings: add UC_ERR_TIMEOUT 2019-12-29 00:19:34 +08:00
David CARLIER
72f7598387 Tests, fixes on third platform. (#1168)
MT linkage fix mainly.
2019-12-29 00:18:40 +08:00
ζeh Matt
3a3bc0c22d Timeout error (#1173)
* Implement timeout state and new error for such case

* Adjust test_i386_loop sample

* Adjust test_i386_loop test
2019-12-29 00:16:54 +08:00
Chen Huitao
95890d593f fix oss-fuzz issue 10578. (#1159) 2019-12-29 00:14:05 +08:00
Audrey Dutcher
3cea38bff7 restrict msbuild to win32 platform (#1172) 2019-11-20 00:34:56 +08:00
naq
3b17db0d84 bindings: update after the last commit on adding ARM modes 2019-10-26 05:02:39 +08:00
meta
ba74552199 Expose different 32-bit ARM CPU models to users via UC_MODE flags (#1165) 2019-10-26 05:01:00 +08:00
w1tcher
83887b8193 Fix the error in the hook_code of the arm, calling emu_stop and causing the pc value to be incorrect after the end of the run. (#1157) 2019-10-25 14:47:29 +08:00
Audrey Dutcher
fd3ccb2ef7 Python packaging logic for msvc build (#1151)
* remove bundling of DLLs we no longer need!

* Add logic for building with msvc in python setup

* Also include the msvc build scripts with sdist
2019-10-10 22:00:42 +08:00
naq
64d03e57d6 pkgconfig: tag 1.0.2-rc1 2019-10-09 05:43:34 +08:00
Chen Huitao
c03f929c75 fix oss-fuzz issue 10334. (#1149) 2019-10-08 10:44:50 +08:00
Chen Huitao
79d89e5d3b fix a mem-leak (#1147)
* fix a mem-leak.

* check the uc and l1_map before using them.

* fix multi-level free bug.

* Add pointer check.
2019-10-05 15:11:46 +08:00
naq
355eaecc12 bindings: update after addition of UC_HOOK_INSN_INVALID 2019-09-23 01:54:24 +08:00
Azertinv
07f94ad1fc Added an invalid instruction hook (#1132)
* first draft for an invalid instruction hook

* Fixed documentation on return value of invalid insn hook
2019-09-23 01:53:06 +08:00
kj.xwings.l
8b659c61b2 Update Makefile (#1146) 2019-09-22 22:32:35 +08:00
naq
57e3509812 Merge branch 'master' of github.com:unicorn-engine/unicorn 2019-09-20 17:28:06 +08:00
naq
27cf6617a3 docs: we no longer requires python2 in building 2019-09-20 17:27:54 +08:00
Chen Huitao
f4cc35a24a compatible with python2 and python3 (#1145)
* compatible with python2 and python3.

* fix python version check in configure of qemu.

* allow python-2.4.

* add credit.
2019-09-20 17:23:12 +08:00
AeonLucid
c46e745338 Fixes #1143 (#1144) 2019-09-16 01:58:08 +08:00
naq
0551b56633 cleanup COMPILE-CMAKE.md 2019-09-08 17:08:00 +08:00
naq
1962cf3580 cleanup COMPILE-CMAKE.md 2019-09-08 17:05:51 +08:00
naq
4c80d9afd4 cleanup 2019-09-08 16:47:38 +08:00
naq
1f98a0dfea CREDITS 2019-09-08 16:45:37 +08:00
Chen Huitao
ca6516ff79 Remove warnings (#1140)
* remove warnings on windows with vs2019.

* remove warnings.
2019-09-08 16:44:16 +08:00
Chen Huitao
60896de9f4 add CMakeList.txt. build windows binary by using vs2019. (#1134)
* add CMakeList.txt. build windows binary by using vs2019.

* remove macro redefinition warning.

* add nmake.bat.

* update CMakeLists.txt. build successfully on Ubuntu-1804-amd64.

* add CMakeList.txt. build windows binary by using vs2019.

* remove macro redefinition warning.

* add nmake.bat.

* update CMakeLists.txt. build successfully on Ubuntu-1804-amd64.

* Add build specific arch option.

* fix old MSVC inline and mipsel macro.

* add install target and option of embeded MSVCRT lib.

* add cmake.sh and document.

* add xwings and chenhuitao as programmer.

* fix COMPILE-CMAKE. rename txt to md.
2019-09-08 16:42:43 +08:00
BAYET
8987ad0fff Handle serialization of cpu context save (#1129)
* 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...
2019-09-07 19:09:17 +08:00
Stephen
6c948b43ba name builds in travis (#1138) 2019-09-07 11:25:13 +08:00
Audrey Dutcher
4fd2f8c524 Final tweaks to MSVC build (#1139)
* Quote paths in msvc postbuildevent scripts

* Update MSVC readme with some new advice
2019-09-07 10:46:28 +08:00
Fish
626d72d6df Two fixes to get unicorn build better with MSVC. (#1136)
* Change MSVC keywords.

typename, class, and class are all keywords for MSVC. Adding a suffix for
all of them allows a successful compilation under VC 2017 (15.9).

* Switch from /ZI to /Zi to avoid crashes at longjmp in debug builds.
2019-09-05 00:53:37 +08:00
Luke Usher
1c1eecd863 msvc: Use default platform toolset (#1091) 2019-09-05 00:52:40 +08:00
Stephen
0961b1f7d5 test appveyor artifacts (#1120)
* test appveyor artifacts

* add msvc and upload after test

* test cygunicorn.dll dependencies

* Update .appveyor.yml

* add ntldd for msys2
2019-09-02 09:09:31 +08:00
Stephen
75d0d5b1d9 brew ignores CC variable (#1131)
* check if brew is respecting CC variable

* brew ignores CC variable
2019-09-02 08:35:57 +08:00
Chen Huitao
23a426625f check arguments, return error instead of raising exceptions. (#1125)
* check arguments, return error instaed of raising exceptions. close #1117.

* remove empty lines. remove thr underscore prefix in function name.
2019-08-23 17:05:13 +08:00
Daniel Deptford
bc572be472 Check for TLB invalidation after read callback(s). (#1122)
* Adding regression test for issue where writing memory into a read only segment during a access callback fails.

* Check for TLB invalidation when calling read callbacks;  Writes to read-only memory by the callback cause a TLB flush which requires a re-read of the TLB.
2019-08-22 17:54:24 +08:00
Stephen
8f0f77233d fix msys2 and travis builds (#1118)
* fix msys2 builds

* move to travis xenial

now the default

* add i386 cmocka

* move to only different cmocka on 32 bit build

* minimize packages on non x86
2019-08-11 17:47:36 +08:00
naq
2a4924b161 Merge branch 'master' of github.com:unicorn-engine/unicorn 2019-08-05 23:00:26 +08:00
naq
9208a6f317 initialize ret=0 in cpu_exec(). issue #1115 2019-08-05 23:00:01 +08:00
Guille Polito
56ac8859b3 Add pharo-unicorn to binding list (#1110)
* Add pharo-unicorn to binding list

* Add Pharo
2019-07-31 15:56:28 +08:00
naq
3eb3a18b56 Merge branch 'master' of github.com:unicorn-engine/unicorn 2019-07-31 15:43:38 +08:00
naq
540c893157 cleanup qemu/cpus.c 2019-07-31 15:43:06 +08:00
Stephen
b55bbd0ac6 fix broken build (#1108)
* fix broken build

* add binutils to path
2019-07-31 12:34:49 +08:00
Stephen
ca6cb2368f remove broken iOS builds (#1109) 2019-07-31 09:33:13 +08:00
Kevin Phoenix
3053e64708 Specify python for building QEMU on macOS (#1107) 2019-07-30 10:49:33 +08:00
kj.xwings.l
24f55a7973 Removed hardcoded CP0C3_ULRI (#1098)
* activate CP0C3_ULRI for CONFIG3, mips

* updated with mips patches

* updated with mips patches

* remove hardcoded config3

* git ignore vscode

* fix spacing issue and turn on floating point
2019-07-06 17:53:02 +08:00
Starlet Leonhart
0cd69ee03b Add ARM64 Android support in make.sh (#1099)
* Add Android ARM64 support.

* Fix some things
2019-07-01 19:24:36 +08:00