DavidSpickett 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;
----------------
labath wrote:
> 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
> #else
>   return 47;
> #endif
> }
> ```
No I don't think so, if you want to run this test the toolchain should have the 
constants. I'll do what you suggested.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87442/new/

https://reviews.llvm.org/D87442

_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to