* Rename `sj`/`s*` and move them under `sH`. Remove `s=`
* Rename `s-*` to `sH-`
* Use `sd` for "seek delta", which moves relative to the current offset
* Enforce <cmd> <arg> syntax. So no more `s+16` but `s +16`. Command
`sHr` is for redo history, `sHu` for undo history. If one wants to move
relative to the current address, they need to do `sd +10`/`sd -10`.
* Remove `ss` commands in favour of `cmd.seek.silent`. This was anyway
used mainly for scripts, so no need to replicate all `s` commands
under `ss`.
Change a bit rz_core_seek API to avoid dupped entries in seek history.
* Fixed memleak on rz_diffchar_new
* extended_arg is not used after line 87
* useless assignment
* use imm not opnd->addr.offset.imm
* fixing usage of op and memleaks related to it
* invalid cc usage on rz_debug_arg_get
* null ptr deref and memleak in gdb_to_rz_profile
* Fixed logic on instruction decoding on amd29k
* Fixed undef negative shift and memleak on mips assembler
* Do not use setenv after fork, it's not async-signal-safe
* Do not use mutexes after fork
If pipe2 is not available on a system, we try to simulate the atomic
setting of O_CLOEXEC in different ways (depending on whether O_CLOEXEC
is at least available or not). However this involves using mutexes. When
forking, only the calling thread is forked, so it is important to lock
the mutex before the fork. However, in the child between the fork and
the exec* it is recommended to use only async-signal-safe functions. mutex
operations are not async-signal-safe, so we just keep track of whether we are
in the child or not and avoid using the mutex as necessary.
* Replace pthread_atfork with rz_sys_fork
* Fix a crash in dts+ command with empty register arenas ##debug
* Allow empty arena bytes when allocating a new arena ##reg
* Added rz_mem_copy as a safe memcpy alternative ##utils
Co-authored-by: Riccardo Schirone <ret2libc@users.noreply.github.com>
Co-authored-by: Anton Kochkov <anton.kochkov@gmail.com>
Co-authored-by: Giovanni <561184+wargio@users.noreply.github.com>
* Make it possible to have escape char in cmd_identifier ##newshell
Fixes: https://github.com/rizinorg/rizin/issues/97
* Add test to check the non existance of "wv8@10" command identifier
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