X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/d9a64523371fa019c4575bb400cbbc3a50ac9903..a991bd8d3e7fe02dbca0644054bab73c5b75324a:/tools/lldbmacros/utils.py diff --git a/tools/lldbmacros/utils.py b/tools/lldbmacros/utils.py index 33d601f8d..6039f2048 100755 --- a/tools/lldbmacros/utils.py +++ b/tools/lldbmacros/utils.py @@ -474,3 +474,12 @@ def print_hex_data(data, begin_offset=0, desc=""): def Ones(x): return (1 << x)-1 +def StripPAC(x, TySz): + sign_mask = 1 << 55 + ptr_mask = Ones(64-TySz) + pac_mask = ~ptr_mask + sign = x & sign_mask + if sign: + return (x | pac_mask) + 2**64 + else: + return x & ptr_mask