xemu/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 Clean up header guards that don't match their file name 2016-07-12 16:19:16 +02:00
cpu_ldst.h accel/tcg: Add endian-specific cpu_{ld, st}* operations 2020-05-11 11:22:06 +01:00
cpu-all.h meson: rename .inc.h files to .h.inc 2020-08-21 06:18:35 -04:00
cpu-common.h exec/cpu-common: Move MUSB specific typedefs to 'hw/usb/hcd-musb.h' 2020-06-12 11:20:15 -04:00
cpu-defs.h osdep: Make MIN/MAX evaluate arguments only once 2020-06-26 09:39:39 -04:00
cputlb.h include: Make headers more self-contained 2019-08-16 13:31:51 +02:00
exec-all.h cputlb: destroy CPUTLB with tlb_destroy 2020-06-16 14:49:05 +01:00
gdbstub.h gdbstub/linux-user: support debugging over a unix socket 2020-05-06 09:29:26 +01:00
gen-icount.h icount: remove unnecessary gen_io_end calls 2019-08-20 17:26:22 +02:00
helper-gen.h tcg: Add support for a helper with 7 arguments 2020-02-11 16:29:16 -08:00
helper-head.h tcg: Add support for a helper with 7 arguments 2020-02-11 16:29:16 -08:00
helper-proto.h tcg: Add support for a helper with 7 arguments 2020-02-11 16:29:16 -08:00
helper-tcg.h tcg: Add support for a helper with 7 arguments 2020-02-11 16:29:16 -08:00
hwaddr.h hw: Clean up includes 2016-06-07 18:19:23 +03:00
ioport.h include: Make headers more self-contained 2019-08-16 13:31:51 +02:00
log.h disas: include an optional note for the start of disassembly 2020-05-15 15:25:16 +01:00
memattrs.h cputlb: Byte swap memory transaction attribute 2019-09-03 08:30:39 -07:00
memop.h cputlb: Replace size and endian operands for MemOp 2019-09-03 08:30:39 -07:00
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 cputlb: Merge and move memory_notdirty_write_{prepare,complete} 2019-09-25 10:44:29 -07:00
memory.h meson: rename .inc.h files to .h.inc 2020-08-21 06:18:35 -04:00
plugin-gen.h plugin-gen: add plugin_insn_append 2019-10-28 15:12:38 +00:00
poison.h Add rx-softmmu 2020-03-19 17:58:05 +01:00
ram_addr.h migration: Count new_dirty instead of real_dirty 2020-07-03 16:23:05 +01:00
ramblock.h ram_addr: Split RAMBlock definition 2020-01-29 11:28:59 +01:00
ramlist.h migration: Poison ramblock loops in migration 2018-06-15 14:40:56 +01:00
softmmu-semi.h include: Make headers more self-contained 2019-08-16 13:31:51 +02:00
target_page.h migration: Make savevm.c target independent 2017-05-18 19:21:00 +02:00
tb-context.h tcg: remove tb_lock 2018-06-15 08:18:48 -10:00
tb-hash.h include: Make headers more self-contained 2019-08-16 13:31:51 +02:00
tb-lookup.h accel/tcg: Consider cluster index in tb_lookup__cpu_state() 2019-02-06 03:39:24 +00:00
translator.h translator: Use cpu_ld*_code instead of open-coding 2020-01-15 15:13:10 -10:00