• F
    linux-user: Extend strace support to enable argument printing after syscall execution · c84be71f
    Filip Bozuta 提交于
        Structure "struct syscallname" in file "strace.c" is used for "-strace"
        to print arguments and return values of syscalls. The last field of
        this structure "result" represents the calling function that prints the
        return values. This field was extended in this patch so that this function
        takes all syscalls arguments beside the return value. In this way, it enables
        "-strace" to print arguments of syscalls that have changed after the syscall
        execution. This extension will be useful as there are many syscalls that
        return values inside their arguments (i.e. listxattr() that returns the list
        of extended attributes inside the "list" argument).
    
    Implementation notes:
    
        Since there are already three existing "print_syscall_ret*" functions inside
        "strace.c" ("print_syscall_ret_addr()", "print_syscall_ret_adjtimex()",
        "print_syscall_ret_newselect()"), they were changed to have all syscall arguments
        beside the return value. This was done so that these functions don't cause build
        errors (even though syscall arguments are not used in these functions).
        There is code repetition in these functions for checking the return value
        and printing the approppriate error message (this code is also located in
        print_syscall_ret() at the end of "strace.c"). That is the reason why a
        function "syscall_print_err()" was added for this code and put inside these
        functions. Functions "print_newselect()" and "print_syscall_ret_newselect()"
        were changed to use this new implemented functionality and not store the syscall
        argument values in separate static variables.
    Signed-off-by: NFilip Bozuta <Filip.Bozuta@syrmia.com>
    Reviewed-by: NLaurent Vivier <laurent@vivier.eu>
    Message-Id: <20200619123331.17387-2-filip.bozuta@syrmia.com>
    Signed-off-by: NLaurent Vivier <laurent@vivier.eu>
    c84be71f
qemu.h 26.0 KB