================
@@ -0,0 +1,19 @@
+#include <assert.h>
+#include <stdint.h>
+#include <stdio.h>
+
+int myglobal = 41;
+
+uint64_t get_high_bits(void *ptr) {
+  uint64_t mask = ~((1ULL << 48) - 1);
+  uint64_t ptrtoint = (uint64_t)ptr;
+  uint64_t high_bits = ptrtoint & mask;
+  printf("Higher bits are = %llx\n", high_bits);
+  return high_bits;
+}
+
+int main() {
+  int x = 42;
+  assert(0 == get_high_bits(&x));
----------------
DavidSpickett wrote:

Not sure we need this, or x. If the address of x is already tagged that means 
we've been built with some stack tagging scheme.

Even in that case lldb will strip the tag bits from the address anyway. Rightly 
or wrongly, but this test is not about right and wrong it's basically 
documentation.

So unless there's another reason you need this, I'd remove it.

https://github.com/llvm/llvm-project/pull/153585
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to