Commit graph

57 commits

Author SHA1 Message Date
Florian Märkl
7e36f4bd38 Add IL lifting testing to rz-test 2022-01-10 19:27:09 +01:00
GustavoLCR
53a7694631
Add support for Windows on ARM (#1502)
* Support building for Windows on ARM

* Fix usage of reserved function name on ARM
* Fix architecture dependent `CONTEXT` fields access

* Fixes for debugging on Windows on ARM

* Fix breakpoint behavior on windows on ARM
* Fix register profile when debugging
* Remove `drx` error message if not supported
* Add support for hardware breakpoints
* Disable support for hardware single-stepping

* Fix Windows Message breakpoints on ARM

* Fix software single-stepping on return instruction on ARM

* Consider link register as destination for return instructions

* Fix setting debug bits to 16

* Rename `r12` to `ip` for windows arm register profile

* Remove debug bits hardcoding on windows

* Add 32bit registers to Windows ARM64 register profile

* Fix software step breakpoint alignment when entering thumb mode

* Define `RZ_TEST_ARCH` for `arm` and `arm64`

* Use `StackWalk64` API for backtracing on Windows

* Fix software single-stepping ARM in thumb mode

* Sync `asm.bits` with debugger

* Cleanup windows_debug.c

* Add SPDX for cross-arm64-windows.txt

* Add floating point control register flags

* Fix Windows Arm register profile alignment

* Keep `drx` warning
2021-11-24 20:13:42 +08:00
Khairul Azhar Kasmiran
906ece4211
Add asan build for clang (#1910) 2021-11-17 21:02:02 +08:00
Khairul Azhar Kasmiran
ac496744c8
Fix #1887: Sync test results with testfile (#1906) 2021-10-30 18:25:25 +08:00
Khairul Azhar Kasmiran
db0fdffc4e
archos/: Support <os>-any test categories (#1795) 2021-10-05 17:33:42 +08:00
wargio
3ba03e4940 Fixed GCC 11 warning in rz-test 2021-09-24 01:52:11 +02:00
Khairul Azhar Kasmiran
fe9e1beed9
archos/: Support any arch for not- categories (#1713) 2021-09-18 20:21:19 +08:00
Khairul Azhar Kasmiran
67e323174b
Add not-windows-x64 category to archos/ (#1700) 2021-09-17 00:06:15 +08:00
Rot127
79751e358e
rz-test: check for undeclared keys to fix segfault. (#1689) 2021-09-15 09:32:58 +00:00
ryancaicse
0b993f9771 Fix un released lock
Fix un released lock state.lock in the main before the program exits.

Signed-off-by: Riccardo Schirone <sirmy15@gmail.com>
2021-09-15 10:31:26 +08:00
Giovanni
8ace435328
Fix coverity bugs (#1654)
* CID 316614: Use after free (USE_AFTER_FREE)
* CID 316535: Use after free (USE_AFTER_FREE)
* CID 316652: Use after free (USE_AFTER_FREE)
* CID 316504: Unsigned compared against 0 (NO_EFFECT)
* CID 316439: Resource leak (RESOURCE_LEAK)
* CID 356127: Dereference after null check (name can never be NULL)
* CID 320881: Resource leak (RESOURCE_LEAK)
* CID 320885: Missing break in switch (MISSING_BREAK)
* CID 316679: Resource leak (RESOURCE_LEAK)
* CID 316574: Explicit null dereferenced (FORWARD_NULL)
* CID 356105: Resource leak (RESOURCE_LEAK)
* Fixed uninitialized building issue
2021-09-11 09:30:57 +02:00
Khairul Azhar Kasmiran
eb262e4df9 Use UTC timezone for tests 2021-09-08 23:14:46 +02:00
Giovanni
cacce543b7
Fix rz-test coverity issues (#1593)
* CID 316425: Resource leak (RESOURCE_LEAK)

* CID 316759: Dereference before null check (REVERSE_INULL)

* CID 354049: Dereference after null check (FORWARD_NULL)

* CID 315924: Out-of-bounds access (OVERRUN)
2021-09-04 14:30:41 +02:00
GustavoLCR
d7e7bae79e
Use wide version of Windows APIs (#1531)
* Use wide version of Windows APIs in subprocess functions
* Use `wmain` on Windows to get UTF16 arguments
* Use wide version of APIs in `rz_cons`
* Always try to set console codepage to UTF8

Co-authored-by: Riccardo Schirone <ret2libc@users.noreply.github.com>
2021-08-27 15:23:26 +08:00
Riccardo Schirone
6041ae6bb3
rz-test: Make sure to correctly free path_left ht (#1372) 2021-07-29 01:14:25 +08:00
Giovanni
7a7ca18e20
Fix some warnings related casting ut8* to char* (#1371)
* Fix some warnings related casting ut8* to char*
* Fixed runtime casting on aes code ut8 to ut32
2021-07-28 17:33:48 +02:00
Giovanni
8fe4d0b0a5
Convert ! commands to newshell (#1235)
* Updated core_plugin_example.c
* Removed RZ_BYTES and RZ_BLOCK
Co-authored-by: Riccardo Schirone <sirmy15@gmail.com>
Co-authored-by: Anton Kochkov <anton.kochkov@gmail.com>
2021-07-28 10:33:33 +02:00
GustavoLCR
1ab628d83d
Fix some clang-cl warnings (#1298) 2021-07-15 12:15:17 +08:00
Khairul Azhar Kasmiran
417d966fb1
rz-test: Remove broken diffchar option (#1158) 2021-05-21 21:17:26 +08:00
Giovanni
6fec281af7
Rewrite rz-diff and internal diffing library (#1126) 2021-05-14 19:47:30 +08:00
seanachao
a2f8631b6c
Change -, --, = argument and = command meaning (#930)
* Swap = & - R (#615)&(#616)
* Fix R replace =
2021-04-21 16:20:24 +08:00
Anton Kochkov
24ee8cb457 Fix Coverity CID 316740 (String not terminated) 2021-04-15 11:42:47 +08:00
Florian Märkl
3bfa44c8f3
Make rz_diff_buffers_unified() use the Subprocess API (#981) 2021-04-08 17:43:02 +02:00
Riccardo Schirone
db04bed503
Fix autocompletion of rz- commands in rizin shell and rename wrong rz_ (#944) 2021-03-31 16:10:54 +02:00
Riccardo Schirone
53bf5c497f SPDX Copyright text for all files based on history
- Add LICENSES directory
- Download additional licenses used
- Add .reuse directory
- Add doc about SPDX/reuse

Co-authored-by: Florian Märkl <info@florianmaerkl.de>
2021-03-05 19:39:15 +08:00
Alexis Ehret
b6f99ec7ba Fix uninitialized data errors for rz-test
test with:
* valgrind -s --track-origins=yes --log-file=log.txt rz-test -C test
* valgrind -s --track-origins=yes --log-file=log.txt rz-test -L -C test
2021-02-24 20:52:16 +01:00
Alexis Ehret
c9230c7f90 Fix memory leak binrz/rz-test/rz-test.c 2021-02-24 20:52:16 +01:00
Riccardo Schirone
10f72d818c
Implement rz_subprocess_start_opt API to choose pipes (#243) 2021-02-22 12:57:31 +00:00
Riccardo Schirone
cee8d470c2 Remove Makefiles and many related scripts 2021-01-28 11:57:28 +01:00
Anton Kochkov
a0be4e2e64 Run clang-format 2021-01-21 22:05:44 +08:00
Anton Kochkov
cd7d4f5dc6 Temporary workaround for clang-format #46240 bug 2021-01-21 22:05:44 +08:00
yossizap
3212a6cf10
Merge pull request #376 from yossizap/fix-reg-trace-crash
Fix trace crash caused by a mismatch between the register profile and op analysis
2021-01-18 16:59:12 +08:00
Qijia Liu
7fd5903ab3 Fix memleak in db/asm/arm_64 2021-01-16 14:13:18 +01:00
yossizap
36e0231251
Added regex documentation to test/README.md (#326) 2021-01-08 21:03:33 +01:00
yossizap
cf53347730
Added support for regex in test output ##test (#269)
* Added REGEX/_ERR to enable regex in EXPECT/_ERR ##test
* Modify output based on REGEXP_OUT/ERR and compare with EXPECT/ERR ##test
2020-12-28 12:04:35 +02:00
Khairul Azhar Kasmiran
0c5bfb2fda
rz-test: Remove unused cmd_buf (#270) 2020-12-27 12:11:48 +01:00
Florian Märkl
40a29cba29
Remove Pseudo-Sandbox (#239) 2020-12-21 21:31:32 +01:00
Riccardo Schirone
69f3da16d0
rz_sys_system should not depend on LIBC_HAVE_FORK (#226) 2020-12-21 09:15:25 +01:00
Riccardo Schirone
286f930b93 Use O_CLOEXEC when creating pipes so they are closed on exec
By default, pipes file descriptors are not closed on exec. This means
they are inherited by the child process. However, this may be a problem
in particular in multi-threading programs (e.g. rz-test), because EOF is
not sent to a pipe until the last pipe file descriptor is closed.

This commit makes sure that by default pipes are created with O_CLOEXEC,
so they are closed whenever an exec syscall is executed. Usually pipe
file descriptors are duplicated to be stdin/stdout/stderr of the
children process and those dupped file descriptors won't be closed on
exec.

In case pipe2 is not available (e.g. MacOS), we do a pipe + fcntl, which
is in theory racy (see man open(2)). For this reason pipe, exec, system,
etc. are wrapped in rz_sys and they use a global mutex to make sure a
pipe is either created and set as O_CLOEXEC or not created at all before
an exec operation is done.

On very old systems, O_CLOEXEC may not be available at all. In those
cases, which should be rare, we just keep a list of file descriptors
created with rz_sys_pipe that we need to close before executing another
process.

Interaction with external libs may be tricky. We expect external libs to
create files/pipes that need to be closed on exec with the right flags
and we expect rizin code to manually close pipes file descriptors as
appropriate if the exec syscall is executed by an external library
(non-rizin code).

Make sure execl is found by acr/make
2020-12-15 10:18:50 +01:00
Riccardo Schirone
5ea4697402 Use RzSubprocess in rz_test 2020-12-15 10:18:50 +01:00
GustavoLCR
f820a489f6 Add option to log r2r test results and publish it in the CI (#17964) ##test 2020-11-24 14:51:44 +01:00
Anton Kochkov
e1d83487a6 More renames of r2 to rizin 2020-11-10 12:24:41 +08:00
Anton Kochkov
afc45bec46 Rename r2 to rizin 2020-11-06 12:21:54 +08:00
Khairul Azhar Kasmiran
7c86add0dc Add 6 minutes to cmd_aae timeout and skip aaa for swift_read fuzz test (#17805)
* Add 6 minutes to the cmd_aae test
* Skip aaa when doing swift_read fuzz test on asan
* Bump linux-meson-gcc-newshell-tests timeout to 60 minutes
2020-10-30 10:44:38 +01:00
Florian Märkl
6572b63794
Use Standard SPDX Header Comments (#51) 2020-10-27 09:04:11 +01:00
Florian Maerkl
a0a26bb07b Add rz_test_subprocess_(un)?lock stubs for Windows 2020-10-13 14:47:53 +02:00
Riccardo Schirone
52ba3f8d39 Rename RStr to RzStr 2020-10-13 12:43:34 +02:00
Riccardo Schirone
b8bf83b856 Rename RStrBuf to RzStrBuf 2020-10-13 12:43:34 +02:00
Florian Märkl
cd11ad6988 Show Disasm Diff in rz-test 2020-10-11 21:13:18 +02:00
Florian Märkl
81bf113d81 Fix a potential race in rz-test reported by helgrind 2020-10-11 21:13:18 +02:00