qemu-e2k/include/exec
Filip Bozuta 888468db94 linux-user: Add strace support for printing arguments for ioctls used for terminals and serial lines
Functions "print_ioctl()" and "print_syscall_ret_ioctl()" are used
to print arguments of "ioctl()" with "-strace". These functions
use "thunk_print()", which is defined in "thunk.c", to print the
contents of ioctl's third arguments that are not basic types.

However, this function doesn't handle ioctls of group ioctl_tty which
are used for terminals and serial lines. These ioctls use a type
"struct termios" which thunk type is defined in a non standard
way using "STRUCT_SPECIAL()". This means that this type is not decoded
regularly using "thunk_convert()" and uses special converting functions
"target_to_host_termios()" and "host_to_target_termios()", which are defined
in "syscall.c" to decode it's values.

For simillar reasons, this type is also not printed regularly using
"thunk_print()". That is the reason why a separate printing function
"print_termios()" is defined in file "strace.c". This function decodes
and prints flag values of the "termios" structure.

Implementation notes:

    Function "print_termios()" was implemented in "strace.c" using
    an existing function "print_flags()" to print flag values of
    "struct termios" fields. Also, recently implemented function
    "print_enums()" was also used to print enumareted values which
    are contained in the fields of 'struct termios'.

    These flag values were defined using an existing macro "FLAG_TARGET()"
    that generates aproppriate target flag values and string representations
    of these flags. Also, the recently defined macro "ENUM_TARGET()" was
    used to generate aproppriate enumarated values and their respective
    string representations.

    Function "print_termios()" was declared in "qemu.h" so that it can
    be accessed in "syscall.c". Type "StructEntry" defined in
    "exec/user/thunk.h" contains information that is used to decode
    structure values. Field "void print(void *arg)" was added in this
    structure as a special print function. Also, function "thunk_print()"
    was changed a little so that it uses this special print function
    in case it is defined. This printing function was instantiated with
    the defined "print_termios()" in "syscall.c" in "struct_termios_def".

Signed-off-by: Filip Bozuta <Filip.Bozuta@syrmia.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20200723210233.349690-4-Filip.Bozuta@syrmia.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
2020-08-27 12:29:50 +02:00
..
user linux-user: Add strace support for printing arguments for ioctls used for terminals and serial lines 2020-08-27 12:29:50 +02:00
address-spaces.h
cpu_ldst.h
cpu-all.h meson: rename .inc.h files to .h.inc 2020-08-21 06:18:35 -04:00
cpu-common.h
cpu-defs.h osdep: Make MIN/MAX evaluate arguments only once 2020-06-26 09:39:39 -04:00
cputlb.h
exec-all.h
gdbstub.h
gen-icount.h
helper-gen.h
helper-head.h
helper-proto.h
helper-tcg.h
hwaddr.h
ioport.h
log.h
memattrs.h
memop.h
memory_ldst_cached.h.inc meson: rename .inc.h files to .h.inc 2020-08-21 06:18:35 -04:00
memory_ldst_phys.h.inc meson: rename .inc.h files to .h.inc 2020-08-21 06:18:35 -04:00
memory_ldst.h.inc meson: rename .inc.h files to .h.inc 2020-08-21 06:18:35 -04:00
memory-internal.h
memory.h meson: rename .inc.h files to .h.inc 2020-08-21 06:18:35 -04:00
plugin-gen.h
poison.h
ram_addr.h migration: Count new_dirty instead of real_dirty 2020-07-03 16:23:05 +01:00
ramblock.h
ramlist.h
softmmu-semi.h
target_page.h
tb-context.h
tb-hash.h
tb-lookup.h
translator.h