[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v1 1/5] linux-user: convert target_mprotect debug to tracepoi
From: |
Richard Henderson |
Subject: |
Re: [PATCH v1 1/5] linux-user: convert target_mprotect debug to tracepoint |
Date: |
Sun, 1 Dec 2019 17:04:40 -0800 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.1 |
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~
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [PATCH v1 1/5] linux-user: convert target_mprotect debug to tracepoint,
Richard Henderson <=