[Lldb-commits] [PATCH] D87442: [lldb] Show flags for memory regions

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Nov 12 05:33:29 PST 2020

labath added inline comments.

Comment at: lldb/test/API/linux/aarch64/mte_memory_region/main.c:9-14
+  if (!(getauxval(AT_HWCAP2) & HWCAP2_MTE))
+    return 1;
+  int got = prctl(PR_SET_TAGGED_ADDR_CTRL, PR_TAGGED_ADDR_ENABLE, 0, 0, 0);
+  if (got)
+    return 1;
DavidSpickett wrote:
> labath wrote:
> > Instead of duplicating these checks in dotest, maybe we could use the result of the inferior as a indication to skip the test. Like, if, instead of hitting the breakpoint, the inferior exits with code 47, we know that the required cpu feature is not supported?
> Sounds good to me. 
> That would mean defining things like PROT_MTE in the test file, for toolchains that won't have it. I assume that's ok to do.
> (I'll probably need to do that for lldb-server code later anyway)
Depends... How likely is the system to support memory tagging if the relevant headers don't define the constants? Do you want to support systems like those?

Maybe you could do something like this:
int main() {
#ifdef HWCAP2_MTE
  // do stuff
  return 47;

  rG LLVM Github Monorepo



More information about the lldb-commits mailing list