On 06/22/2018 03:30 AM, Peter Maydell wrote:
>> +struct SyscallDef {
>> +    const char *name;
>> +    SyscallArgsFn *args;
>> +    SyscallImplFn *impl;
>> +    SyscallPrintFn *print;
>> +    SyscallPrintRetFn *print_ret;
> 
> Are all these hook functions mandatory, or can a syscall
> implementation leave some of them NULL for a default behaviour?

Only impl is mandatory.  You're right that there should be more doco here at
the structure definition.  Here, the docs got split down to the macros that
define the most common forms of the structures.  Will fix.


>>  static void
>>  print_flags(const struct flags *f, abi_long flags, int last)
>>  {
>> -    const char *sep = "";
>> -    int n;
>> +    char buf[256];
>> +    add_flags(buf, sizeof(buf), f, flags, false);
>> +    gemu_log("%s%s", buf, get_comma(last));
>> +}
> 
> All this refactoring of the strace functions feels like it
> should have been in a separate patch...

Fair.


r~

Reply via email to