IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an
email to Administrator. User accounts are meant only to access repo
and report issues and/or generate pull requests.
This is a purpose-specific Git hosting for
BaseALT
projects. Thank you for your understanding!
Только зарегистрированные пользователи имеют доступ к сервису!
Для получения аккаунта, обратитесь к администратору.
The SCSI driver, starting with kernel commit v2.6.25-rc1~1230^2~78,
translates its "struct request.errors" to ioctl errors after
filling in all the output members of the SG_IO header structure.
As there is no easy way to tell SCSI layer errors from other syscall
errors, decode the structure on exiting syscall in case of syserror,
too.
* scsi.c (scsi_ioctl): Do not call set_tcb_priv_ulong, use
get_tcb_priv_data instead of get_tcb_priv_ulong, call decode_sg_io
unconditionally.
* sg_io_v3.c (decode_request): Save a copy of struct_sg_io_hdr using
set_tcb_priv_data.
(decode_response): Restore it using get_tcb_priv_data. Print its i/o
fields when umove call fails. Pass IOV_DECODE_STR to tprint_iov_upto
unconditionally.
* sg_io_v4.c (decode_request): Save a copy of struct sg_io_v4 using
set_tcb_priv_data.
(decode_response): Restore it using get_tcb_priv_data. Print its i/o
fields when umove call fails. Pass IOV_DECODE_STR to tprint_iov_upto
unconditionally.
The formerly used format string %02x led to misleading output as there
was no clear indication sometimes whether the printed integer was
decimal or hexadecimal.
* sg_io_v3.c (decode_response): Print status and masked_status fields
using %#x format specifier instead of %02x.
The tradition is to print scsi status codes in a hexadecimal form.
* sg_io_v4.c (decode_response): Print driver_status, transport_status,
and device_status fields using %#x format specifier instead of %u.
The tradition is to print scsi tags in a hexadecimal form.
* sg_io_v4.c (decode_request): Print request_tag field
using ("%#" PRI__x64) format string.
(decode_response): Print generated_tag field using ("%#" PRI__x64)
format string.
As the nature of this field is pointer-like, print it
in a hexadecimal form.
* sg_io_v4.c (decode_request): Print usr_ptr field
using ("%#" PRI__x64) format string.
As the kernel does not touch these fields, there is no use
to print them.
* sg_io_v4.c (decode_request): Do not print spare_in field.
(decode_response): Do not print spare_out field.
Print struct sg_io_hdr.info and struct sg_io_v4.info using printflags.
* xlat/sg_io_info.in: New file.
* defs.h (sg_io_info): New xlat prototype.
* sg_io_v3.c: Include "xlat/sg_io_info.h".
(decode_response): Print struct_sg_io_hdr.info using printflags.
* sg_io_v4.c: (decode_response): Print struct sg_io_v4.info
using printflags.
Print struct sg_io_hdr.flags and struct sg_io_v4.flags using printflags.
* xlat/sg_io_flags.in: New file.
* sg_io_v3.c: Include "xlat/sg_io_flags.h".
(decode_request): Print struct_sg_io_hdr.flags using printflags.
* xlat/bsg_flags.in: New file.
* sg_io_v4.c: Include "xlat/bsg_flags.h".
(decode_request): Print struct sg_io_v4.flags using printflags.
struct sg_io_hdr contains pointers and therefore has to be mpersified.
* defs.h (decode_sg_io_v3): Remove prototype.
* sg_io_v3.c (struct_sg_io_hdr): Typedef to struct sg_io_hdr.
Mpersify it.
(decode_sg_io_v3): Wrap into MPERS_PRINTER_DECL.
* scsi.c (print_sg_io_v3_res): Detect and print changes
of struct sg_io_hdr.interface_id field between entering and exiting
syscall.
(print_sg_io_v4_res): Detect and print changes of struct sg_io_v4.guard
field between entering and exiting syscall.
* scsi.c (print_sg_io_v3_req): Always print the name
of struct sg_io_hdr.interface_id field.
(print_sg_io_v4_req): Always print the name of struct sg_io_v4.guard
field.
(print_sg_io_req): Print unknown interface id as an integer.
(scsi_ioctl): Save interface id on entering syscall and use it
on exiting syscall.
The formerly used format string %x led to misleading output as there was
no clear indication sometimes whether the printed integer was decimal or
hexadecimal.
* aio.c (startup_child, test_ptrace_seize): Print status
using %#x format specifier instead of %x.
The formerly used format string %x led to misleading output as there was
no clear indication sometimes whether the printed integer was decimal or
hexadecimal.
* aio.c (print_common_flags): Print struct iocb.aio_flags using %#x
format specifier instead of %x.
* tests/aio.c (main): Likewise.
As printstr_ex has got QUOTE_FORCE_HEX flag support, there is no need
to implement it manually any longer.
* scsi.c (print_uchar): Remove.
(print_sg_io_buffer): Rewrite using printstr_ex(QUOTE_FORCE_HEX).
Since there is no reason to interpret the value returned by getrandom as
ASCII string, it makes sense to always print it as a hex-escaped string.
* getrandom.c (SYS_FUNC(getrandom)): Use printstr_ex instead
of printstrn, set QUOTE_FORCE_HEX in user_style parameter in order
to force hex-escaped string formatting.
* tests/getrandom.test: Remove no longer needed -xx flag as the string
is always printed in hexadecimal format now.
Suggested-by: JingPiao Chen <chenjingpiao@gmail.com>
This could be useful in cases when some binary data should not be
interpreted as an ASCII string, but rather as an array of byte values.
* defs.h (QUOTE_FORCE_HEX): New macro constant.
* util.c (quote_string): Enable use_hex when QUOTE_FORCE_HEX is set
in user_style parameter.
The case of unset verbose is handled by umoven_or_printaddr, moreover,
exiting at this point is plain wrong and leads to last argument not
being printed while it should be.
* term.c (decode_termios, decode_termio, decode_winsize, decode_ttysize,
decode_modem_flags): Do not check verbose flags explicitly and do not
exit early if it is not set.
Due to a bug in glibc readahead syscall wrapper on MIPS n64,
this wrapper cannot be used in readahead.test.
* tests/readahead.c [HAVE_READAHEAD && LINUX_MIPSN64 && glibc < 2.25]:
Undefine HAVE_READAHEAD.
Reported-by: James Cowgill <james410@cowgill.org.uk>
* tests/ioctl_v4l2.c (cc0, cc1, cc2, cc3, fourcc): New macros.
(main): Use them. Rewrite expected output without assumptions
on any particular magic data.
As these functions behave like memset, it's more convenient to have
the first argument of type void * like memset.
* tests/fill_memory.c (fill_memory, fill_memory_ex): Change the type
of first argument from "char *" to "void *".
* tests/tests.h (fill_memory, fill_memory_ex): Likewise.
Drop custom vfprintf implementation that was disabled by default.
Apparently nobody tests strace with this vfprintf enabled, otherwise
multiple uses of format specifiers not supported by this custom vfprintf
would not left unnoticed.
The GNU C library is not the only libc available, so those who want
faster implementations of libc functions are encouraged to try building
strace with other libc implementations.
* vsprintf.c: Remove.
* Makefile.am (strace_SOURCES): Remove vsprintf.c.
* defs.h (USE_CUSTOM_PRINTF, strace_vfprintf): Remove.
* strace.c (tprintf): Replace strace_vfprintf with vfprintf.
The verbose flag is responsible for dereferencing of addresses, and it
is perfectly handled by umove_or_printaddr; moreover, this early exit
leads to incorrect formatting of last argument.
* loop.c (loop_ioctl): Do not check verbose flag explicitly and do not
exit early if it is not set.
lo_encrypt_key is a sized string with its size specified by
lo_encrypt_key_size field, so take lo_encrypt_key_size into account.
* loop.c (decode_loop_info, decode_loop_info64): Use minimum of
LO_KEY_SIZE and lo_encrypt_key_size field value as lo_encrypt_key size.
It is converted to an unsigned value in kernel (see loop_info64_from_old
in drivers/block/loop.c), so let's print it that way despite its type.
* loop.c (decode_loop_info): Print lo_encrypt_key_size as an uint32_t
value.
* tests/ioctl.c (main): Additional check for unknown ioctl command
decoding.
* tests/ioctl_evdev.c (main): Likewise.
* tests/ioctl_dm.c: Include <linux/ioctl.h> for _IOC_SIZE and _IOC_NR.
(main) <dummy_dm_ioctl1, dummy_dm_ioctl2, dummy_dm_arg>: New constants.
Add more checks for unknown command formatting.
Specifying output width for size argument is rather misleading - it can
be up to 14 bits in size. The use of explicit "0x" prefix is
discouraged because 0x0 looks ugly. Usage of width specification along
with alternate form flag leads to inconsistent output for 0.
Let's use just plain %#x qualifiers instead.
* ioctl.c (ioctl_print_code): Change printf qualifiers for ioctl command
type, number and size to "%#x".
* tests/ioctl.c (main): Update expected test output.
* tests/ioctl_dm.c (main): Likewise.
* tests/ioctl_evdev.c (main): Likewise.
They are of char type, so "hh" length modifier should be used (otherwise
they are printed incorrectly as they are sign extended implicitly when
passed as printf arguments in case char is a signed type which is true
for most compilers).
* loop.c (decode_loop_info): Change "%#x" printf qualifier to "%#hhx"
in printing routine for array elements of the "reserved" field of
loop_info structure.
* strace.c: Remove __NR_tkill checks, assume it is always defined.
* util.c: Remove __NR_process_vm_readv checks and fallback definitions,
assume it is always defined.
Generate scno.h using only those tools that are available for cross
build. This allows to use scno.h during the build of strace itself.
* scno.am: New file.
* scno.head: New file.
* Makefile.am (EXTRA_DIST): Add it.
* tests/generate_scno.c: Remove.
* tests/.gitignore: Remove generate_scno.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(CLEANFILES): Remove scno.h.
(scno.h, $(scno_dependants)): Remove rules.
(scno_dependants): Remove.
($(objects)): New rule.
Include ../scno.am.
* COPYING: Update copyright year number range.
* configure.ac: Likewise.
* strace.c: Likewise.
* tests/strace-V.test: Use the current year for the check.
Limit the number of files where <asm/unistd.h> is included
to only those few that need it.
* defs.h: Do not include <asm/unistd.h>.
* clone.c: Include <asm/unistd.h>.
* strace.c: Likewise.
* syscall.c: Likewise.
* util.c: Likewise.