On 11/28/19 7:45 PM, Alex Bennée wrote: > -#ifdef DEBUG_MMAP > - printf("mprotect: start=0x" TARGET_ABI_FMT_lx > - "len=0x" TARGET_ABI_FMT_lx " prot=%c%c%c\n", start, len, > - prot & PROT_READ ? 'r' : '-', > - prot & PROT_WRITE ? 'w' : '-', > - prot & PROT_EXEC ? 'x' : '-'); > -#endif > + if (TRACE_TARGET_MPROTECT_ENABLED) { > + char prot_str[4]; > + prot_str[0] = prot & PROT_READ ? 'r' : '-'; > + prot_str[1] = prot & PROT_WRITE ? 'w' : '-'; > + prot_str[2] = prot & PROT_EXEC ? 'x' : '-'; > + prot_str[3] = 0; > + trace_target_mprotect(start, len, prot_str); > + }
There are other bits in prot other than these 3. See especially my linux-user BTI patch set, and know that the same sort of thing will be in the as-yet undecided abi for the MTE extension. Unless you have a good reason otherwise, I think we should just print the numeric value in hex. r~