linux-user: Add an api to print enumareted argument values with strace
commit45f567994c2f0272cede9956ed0ea0d8a6294495
authorFilip Bozuta <Filip.Bozuta@syrmia.com>
Tue, 11 Aug 2020 16:45:52 +0000 (11 18:45 +0200)
committerLaurent Vivier <laurent@vivier.eu>
Thu, 27 Aug 2020 10:29:50 +0000 (27 12:29 +0200)
tree4c12cb546ff797124a364ad69c5f0d5698298d4b
parent02e5d7d78e423bf8b3ebb66ab36bdaa7e962312a
linux-user: Add an api to print enumareted argument values with strace

This patch introduces a type 'struct enums' and function 'print_enums()'
that can be used to print enumerated argument values of some syscalls
in strace. This can be used in future strace implementations.

Also, macros 'ENUM_GENERIC()', 'ENUM_TARGET()' and 'ENUM_END', are
introduced to enable automatic generation of aproppriate enumarated
values and their repsective string representations (these macros are
exactly the same as 'FLAG_GENERIC()', 'FLAG_TARGET()' and 'FLAG_END').

Future patches are planned to modify all existing print functions in
'strace.c' that print arguments of syscalls with enumerated values to
use this new api.

Signed-off-by: Filip Bozuta <Filip.Bozuta@syrmia.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20200811164553.27713-5-Filip.Bozuta@syrmia.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
linux-user/strace.c